I have been writing a 2D game on Unity 4.3. I have a player object with box collider 2D with Kinematic Rigidbody. I have another object with box collider 2D with trigger.
For some reason OnTriggerEnter2D event is not firing.
According to documentation this should work.
http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html
If I applied 3D physics to these objects instead of 2D physics it starts to work fine.
Can anyone provide some help on this?
Hello i know this is an old post but if some one stumbles apon it with this issue.
A solution is to make the colliders triggers by clicking the box and then using OnTriggerEnter() or OnTriggerEnter2D() depending if its a Rigidbody or Rigidbody2D.
Edit: My other answer was incorrect.
I tested the minimal scene myself, and it seems not to trigger the event as long as isKinematic on the rigidbody is true. If you set it to false, it fires up correctly.
According to Rigdbody2D.isKinematic documentation, setting isKinematic to true will prevent the rigidbody from participating in physics calculations, including collision events…
It’s not really clear if this is supposed to include launching the callback methods and trigger events, or just not be affected by forces, but the documentation is a bit different in this aspect than the 3d Rigidbody.isKinematic.
I suggest reporting this to unity support and see what they say.
It seems that Box 2D doesn’t support that.
· A fixture on a static body can only collide with a dynamic body.
. A fixture on a kinematic body can only collide with a dynamic body.
from http://www.box2d.org/manual.html