I have a gun that fires projectiles.
I also have several physics bodies in my scene.
The projectiles and the other physics bodies all have simulate physics ‘on’
The projectiles have gravity off, the same goes for some of the physics bodies.
All the physics bodies are set up to ‘generate hit events’ and ‘generate overlap events’
Now here’s what’s strange:
If I start the game and shoot at an object with gravity turned on - everything is fine, collission works as expected, and hit/overlap is called.
If I shoot at an object with gravity off - the physics interaction works as expected, but no hit/overlap events are called.
And now for the super-strange: If a physics object with no gravity hits another physics object with gravity - suddenly I can shoot at the no-gravity object and hit/overlap events work as expected.
To summarize:
Physics body w/gravity + physics body w/gravity → works
Physics body wo/gravity + physics body wo/gravity → does not work
Physics body wo/gravity + physics body w/gravity → works
Physics body wo/gravity that hits a physics body w/gravity + physics body wo/gravity → suddenly works
Please help!
I have a sample project I can upload to demonstrate.
When my bullet hits the target, the bullet is destroyed in the bullets ‘onHit’ event.
But - it seems the bullet is destroyed without firing the ‘onHit’ or the ‘onOverlap’ event on the target.
If I turn off the bullet destruction in the ‘onHit’ event in the bullet, the ‘onHit’ is fired on the target.
If I turn on the bullet destruction in the ‘onHit’ event in the bullet, no event is fired on the target.
This is counter intuitive. I would expect that when there was a collission between two physics objects, both events would fire simultanously.
Is there a setting somewhere to enable this behavior?