Allow A Object To Not obey Gravity

I want all my objects but one to be affected by gravity. Is there a way to void it out for a certain object? [import]uid: 29032 topic_id: 9263 reply_id: 309263[/import]

You can set bodyType to “static” or “kinematic”.

http://developer.anscamobile.com/reference/index/bodybodytype

Or you can just not add a physics body to it. [import]uid: 49978 topic_id: 9263 reply_id: 33786[/import]

The problem with that is that if you make one object kinematic or static, you run into problems with the object not colliding with other objects anymore.

For example, if you have a bunch of static objects that define the walls or terrain in a game, and you want your flying object to not respond to gravity, and you set it as kinematic, it’ll pass through the terrain.

It’s not impossible to solve the problem, but it requires a lot of extra work compared to if you could just have a “respondsToGravity=false” flag…

An alternate solution would be to keep things dynamic, but turn off gravity and simulate gravity by adding a force in each enterFrame
good luck!
[import]uid: 53578 topic_id: 9263 reply_id: 33793[/import]