noob Q: how to get collision "onEnter"/"onExit"?

khoowaikeong
Posts: 43
Joined: Fri Jun 15, 2012 7:11 am

noob Q: how to get collision "onEnter"/"onExit"?

Post by khoowaikeong »

basically only want the collision to do damage once to every object, what is the best way to implement this to a normal collision rigid body?
CireNeikual
Posts: 19
Joined: Thu Jun 28, 2012 5:06 pm

Re: noob Q: how to get collision "onEnter"/"onExit"?

Post by CireNeikual »

Just check for collision, and keep a boolean for the hit test result of the previous frame. If the current test hit and the previous failed, it entered the collision. If it hit the previous frame but fails in the current frame, it exited the collision.
khoowaikeong
Posts: 43
Joined: Fri Jun 15, 2012 7:11 am

Re: noob Q: how to get collision "onEnter"/"onExit"?

Post by khoowaikeong »

"keep a list" suggest bullet can't do this by itself correct?