Rhythm Posted September 16, 2015 Share Posted September 16, 2015 I'm new to Phaser and having issues with P2 physics. An object I've tagged as being "immovable" is, well, moving. It's a bit "blink and you'll miss it" but the ground here is immovable, has gravity disabled and is constrained by the world bounds too but as you can see, it's definitely responding to impacts from objects dropping in. I've dug through the documentation but can't find anything else that should affect this object. Is there anything else I should be considering? Thanks for your help :-) Link to comment Share on other sites More sharing options...
Tilde Posted September 16, 2015 Share Posted September 16, 2015 Did you set its _body_ to immovable rather than the sprite itself? Link to comment Share on other sites More sharing options...
slightlybentOR Posted September 16, 2015 Share Posted September 16, 2015 I'm new to Phaser and having issues with P2 physics. An object I've tagged as being "immovable" is, well, moving. This is what I've done for objects I want to be non-moving... sprite.body.immovable = true;sprite.body.moves = false; Link to comment Share on other sites More sharing options...
chg Posted September 16, 2015 Share Posted September 16, 2015 For P2 bodies "immovable" ground would involve setting the STATIC property to true, I think; you're not trying to set an "immovable" property to true are you? (that's just applies to Arcade bodies I believe) Tilde, Rhythm and DonFrag 3 Link to comment Share on other sites More sharing options...
Rhythm Posted September 16, 2015 Author Share Posted September 16, 2015 Aha, thanks chg, looks like I've been mixing properties/models. I knew I must have been overlooking something simple :-) Tilde 1 Link to comment Share on other sites More sharing options...
DonFrag Posted September 17, 2015 Share Posted September 17, 2015 For P2 bodies "immovable" ground would involve setting the STATIC property to true, I think; you're not trying to set an "immovable" property to true are you? (that's just applies to Arcade bodies I believe)THIS mark as answered Link to comment Share on other sites More sharing options...
Rhythm Posted September 17, 2015 Author Share Posted September 17, 2015 THIS mark as answeredHave done, thanks Link to comment Share on other sites More sharing options...
Recommended Posts