Player hopping on scene restart


i have a platformer, with a matter.js player sprite, and a button that restarts the level with


works fine, but on restart my player jumps continually until i reach another platform. do i have to destroy() something on restart? or turn an event off?


What makes the player jump in the first place?


thanks for your reply.

that would be keydown input. so keydown input continues after a scene has been stopped and restarted?

im wondering what all i would have to destroy() at the end of a scene. i read some posts that said events and particles, but also sprites and tilemaps? class variables?


Yes, it sounds like the key is just stuck in the down state. I don’t think you need to destroy anything extra, Phaser usually does all that. If you have your state variables/properties, you should reset them.

Look in the CHANGELOG and issues for the key problem, it sounds familiar.


thanks samme