oom1993 Posted June 19, 2018 Share Posted June 19, 2018 Hi, I am currently facing an issue where I am trying to replicate a sprite stopping after each update. Just like in this example https://phaser.io/examples/v2/input/keyboard-justpressed I'm using similar input and velocity changes to the example aswell. However when I add these two lines of code at the start of update(). sprite.body.velocity.x = 0; sprite.body.velocity.y = 0; None of my sprites are visible on the screen. I have tried commenting out most code that could possibly affect this with no luck. I am using phaser 2.6.2. Without those two lines of code, my program works as normal but the sprites continue to move. I also tried the below line but had no luck. sprite.body.velocity.setTo(0, 0) Has anyone experienced a similar problem or is there an alternative to stopping a sprite in each update call? Many thanks Link to comment Share on other sites More sharing options...
casey Posted June 20, 2018 Share Posted June 20, 2018 Can you post the rest of your code? Link to comment Share on other sites More sharing options...
Recommended Posts