brejep Posted March 4, 2014 Share Posted March 4, 2014 I'm converting a platform game to Phaser 1.2 / 2 and at a couple of points I have used setRectangle to change the size of the sprite's body. This seems to break collisions with the ground, i.e. the sprite just falls through the floor. Is this because setRectangle clears shapes? If so do I need to do something to make the collisions work again after calling setRectangle? Link to comment Share on other sites More sharing options...
rich Posted March 4, 2014 Share Posted March 4, 2014 If you do setRectangle/Circle/etc you'd need to set the collision mask again after, as it's a Shape property and setRect clears all the shapes on the old Body. Link to comment Share on other sites More sharing options...
brejep Posted March 4, 2014 Author Share Posted March 4, 2014 OK, that's what I thought might be happening. Thanks. Link to comment Share on other sites More sharing options...
valueerror Posted March 5, 2014 Share Posted March 5, 2014 you are not the first one to hit this problem here.. @rich.. if there isn't a hint in the docs right now.. i guess it would be great .. thx Link to comment Share on other sites More sharing options...
valueerror Posted March 9, 2014 Share Posted March 9, 2014 actually.. there are a lot of usecases where you would change for example the size of the circle - it would be really great if this would remember all the other settings and not clear all of them Link to comment Share on other sites More sharing options...
Recommended Posts