Scenes array has a scene but cannot load it

console.log(this.Game.scene)

image

If I do:

console.log(this.Game.scene.scenes[0])

The returned value is undefined. How can I load the layer? I also cant do:

console.log(this.Game.scene.scenes.get("LayerMap"));

Because I get this.Game.scene.scenes.get is not a function

I’m using this inside a VUE component, don’t know I may be an issue. I’m puzzled because I do can access the Phaser game component.

What are you trying to do? Start the game? Start the scene?

GET the scene.

I want to add and empty graphics object.

this.Game.scene.getScene("LayerMap")

I get null when:

console.log(this.Game.scene.getScene("LayerMap"));

If I do:

console.log(this.Game.scene);

In the same code block I did the getScene, I do get something, the SceneManager object. So I do not think is something related with the scope, but I’m no good with JS, in fact, I hate it, lol.

Either layerMap is the wrong key or the layerMap scene hasn’t been added yet.