# Scene update stops working

**URL:** <https://phaser.discourse.group/t/scene-update-stops-working/2877>\
**Category:** Phaser 3\
**Created:** [June 23, 2019, 4:12pm UTC](https://phaser.discourse.group/t/scene-update-stops-working/2877 "2019-06-23T16:12:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PappasBiology](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/pappasbiology/32/354_2.png) [@PappasBiology](https://phaser.discourse.group/u/PappasBiology)\
**Post date:** [June 23, 2019, 4:12pm UTC](https://phaser.discourse.group/t/scene-update-stops-working/2877/1 "2019-06-23T16:12:59Z")

</div>

I am working on a game where I have different environments in separate scenes. The scenes are randomly selected. Everything is working as expected, until it doesn’t. I can’t find a pattern to when it stops, but it is always the scene that is listed last in config that is affected (I have switched the order to test). The scene creates properly, but the player won’t move with key commands.

Any ideas on a solution? I’ve considered that this may not be how scenes were intended to be used and this is entirely the wrong approach for what I want to do.

The current scenes:

> scene: [Start, ShallowSea, OpenOcean]

Here is the create function in the Start scene. The start scene currently preloads all images and has a “click to start” message. On the click, a random scene is selected. This function is used again when the player completes each scene.

> create(){  
> this.add.image(400, 300, ‘clickStart’);  
> this.input.once(‘pointerdown’, selectScene, this);  
> }

The function to randomly select the scene

> function selectScene(){  
> var sceneSelect = Phaser.Math.Between(1, 2);  
> if (sceneSelect == 1){  
> var ecosystem = ‘openOcean’  
> } else if (sceneSelect == 2){  
> var ecosystem = ‘shallowSea’  
> }  
> this.scene.start(ecosystem);  
> }

Here is a link to the current game: [https://taxonomygame.netlify.com/](https://taxonomygame.netlify.com/)  
The gray oval functions as the player. Entering the circle thing at the end starts the next scene.

---

<div class="post-metadata">

**Author:** ![Benstrocity](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@Benstrocity](https://phaser.discourse.group/u/Benstrocity)\
**Post date:** [June 24, 2019, 5:04pm UTC](https://phaser.discourse.group/t/scene-update-stops-working/2877/2 "2019-06-24T17:04:41Z")

</div>

Following this. I don’t see what could be wrong based on what you’ve provided.

So it loads your scene, you are just unable to send input to the game? The only thing that could be is your scene is unable to see your cursor key bindings.

---

<div class="post-metadata">

**Author:** ![Jake.Caron](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jake.caron/32/1841_2.png) [@Jake.Caron](https://phaser.discourse.group/u/Jake.Caron)\
**Post date:** [June 24, 2019, 5:23pm UTC](https://phaser.discourse.group/t/scene-update-stops-working/2877/3 "2019-06-24T17:23:23Z")

</div>

As Ben said, there isn’t enough information on this to really help. Can you set up a simple, stripped-down example on [CodePen.io](http://CodePen.io) or something?

---

<div class="post-metadata">

**Author:** ![PappasBiology](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/pappasbiology/32/354_2.png) [@PappasBiology](https://phaser.discourse.group/u/PappasBiology)\
**Post date:** [June 24, 2019, 8:11pm UTC](https://phaser.discourse.group/t/scene-update-stops-working/2877/4 "2019-06-24T20:11:23Z")

</div>

Here’s more of the code I’m using. (I’m not too familiar with CodePen and similar options, so I’m trying this before I delve into that).

game config  
 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/c/c12e0c91622fe0c994b3c77f59448303e67132e8.png)

The create() for one of the two scenes that are randomly selected. The other scene is nearly identical in set up, differences are in the images.

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/2/206d628aab6f4c6ef83c8f890df55b293f3cd34e.png)

The update() for a scene. Again, the other one is the same.

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/6/675f4359cc072607a0504e9a9645b136027e5a36.png)

---

<div class="post-metadata">

**Author:** ![PappasBiology](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/pappasbiology/32/354_2.png) [@PappasBiology](https://phaser.discourse.group/u/PappasBiology)\
**Post date:** [June 24, 2019, 8:14pm UTC](https://phaser.discourse.group/t/scene-update-stops-working/2877/5 "2019-06-24T20:14:12Z")

</div>

Yes, the weird thing is that the scene is using the cursor key bindings just fine when the scene comes up some of the time…it may make it through 2, 5, 10 runs before it stops responding. Is there any reason the key bindings would work once, but then not work the next time the scene starts?
