For some unknown reason, in this project…
https://playcanvas.com/project/1052896/overview/Expunged’s%20Unfair%20Platformer
…when entering another stage while playing the game, the jumping portion of the movement script doesn’t work properly, and it only gives this error:
[[movementone.js?id=126367797&branchId=91c78a18-6699-4f19-931e-81c8b28eaebd:69]](https://playcanvas.com/editor/code/1052896?tabs=126367797&line=69&col=27&error=true): Uncaught TypeError: Cannot read properties of undefined (reading 'applyImpulse')
TypeError: Cannot read properties of undefined (reading 'applyImpulse')
at Movementone.onKeyDown (https://launch.playcanvas.com/api/assets/files/Misc/scripts/movementone.js?id=126367797&branchId=91c78a18-6699-4f19-931e-81c8b28eaebd:69:27)
at Keyboard.fire (https://code.playcanvas.com/playcanvas-1.61.3.js:615:18)
at Keyboard._handleKeyDown (https://code.playcanvas.com/playcanvas-1.61.3.js:10968:9)
I’ve gone through the code and nothing seems to be wrong with it, even though it highlights this part of it:
this.entity.rigidbody.applyImpulse(0, 10, 0);
Here’s the whole script:
https://playcanvas.com/editor/code/1052896?tabs=126367797