I need to switch the physics for a body on/off during runtime. I was looking through
the API but didn’t found something right. I can not remove the body completely.
What is the best way …??
Any help… [import]uid: 12632 topic_id: 4661 reply_id: 304661[/import]
Some additions to my question, maybe I can not switch off the physics but is it possible to
turn off and on the collision detection on a physics body?
Lets say is it possible to set dynamicly the objects filter conditions for collision detection? [import]uid: 12632 topic_id: 4661 reply_id: 14750[/import]
Ok, found it by myself!!
For everybody who needs temporary no collision with a physics body you can set
isBodyActive = false. So you have no physics activity until you set isBodyActive = true
Hope this is helpfull
Michael [import]uid: 12632 topic_id: 4661 reply_id: 14782[/import]
Hey thanks Michael!! I was about to look this up soon as I had the same need as you to “deactivate” physics on an object-by-object basis!! Well done and thanks!!
-Mario [import]uid: 11636 topic_id: 4661 reply_id: 14911[/import]
I realize this is an old case, but I can confirm.
Using:
objectName .isBodyActive = false
followed by
objectName .isBodyActive = true
works perfectly.
Cheers,
Jerry Palmroos
Charlotte [import]uid: 151653 topic_id: 4661 reply_id: 117228[/import]