Error trying to use assetsmanager.load()

Hi, I’m pretty new to BabylonJS so it’s very likely that this is on me.
Upon trying to call assetsManager.load(), my browser returns this message:
Captura de tela de 2020-07-27 13-45-58

And looking on the code (minified version formatted), the last reference to the getEngine() function is very early in the code, so idk if the part that’s calling it has access to it or not.

Also, here’s a snippet of my code:

this.assets["menu"] = new BABYLON.AssetsManager(scene);
        var background;
        this.assets["menu"].addImageTask(background,"./Assets/Menu/background.png").onSuccess = task =>{
            background = task.image;
            background.x = 0;
            background.y = 0;
            background.width = window.innerWidth;
            background.height = window.innerHeight;
            console.log("bg ok!");
        };    
        var playbutton;
        this.assets["menu"].addImageTask(playbutton,"./Assets/Menu/playbutton.png").onSuccess = task=>{
            playbutton = task.image;
            console.log("button ok!");
        };
        console.log(typeof(this.assets["menu"]));
        this.assets["menu"].load();

I’m sorry if it’s something obvious.

Thanks for the help in advance!

hey and welcome

we will need you to repro the issue in the playground to help you further

Hi!
Let me try and do that.

Hello, it was really my fault. I was trying to create an Assetmanager to the scene before creating the scene itself.

Thanks for the help!