Zenryo Posted June 14, 2014 Share Posted June 14, 2014 Hi! I saw many people has this problem, but I can't see any working solution yet.I have my tilemap loaded, a sprite with physical body and a overlap function.If I am moving my sprite like sprite.body.velocity.x=100 the overlap function between the sprite and the tile works.But if I am moving it like sprite.x+=100, then the overlap function doesn't work, but the sprite clearly overlapping the tile layer. Is there any solution for this problem?Thank you for your answers! Link to comment Share on other sites More sharing options...
lewster32 Posted June 14, 2014 Share Posted June 14, 2014 Have you tried sprite.body.x += 100? The body and the sprite positions are not always aligned. You may want to try doing game.debug.body(sprite) in your render function to see if the bodies are indeed overlapping. If you need to continue to manipulate the position of the sprite without using velocity, you should set sprite.body.moves = false so that it doesn't try to interpolate your position changes. Zenryo 1 Link to comment Share on other sites More sharing options...
Zenryo Posted June 14, 2014 Author Share Posted June 14, 2014 WOW! Your sprite.body.moves = false solution works perfectly!Thank you for your help (again)! lewster32 1 Link to comment Share on other sites More sharing options...
lewster32 Posted June 14, 2014 Share Posted June 14, 2014 No problem Link to comment Share on other sites More sharing options...
Recommended Posts