- Home /
Kinematic Rigidbody Collider not colliding with Static Trigger Collider
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?
I just ran into this same problem. I'm attempting to make PONG as a test-run of Unity's new 2D features and my kinematic rigidbody circle collider is not triggering OnTriggerEnter2D when it hits a static trigger edge collider.
As with the original poster, when the ball is put under control of the physics solver (by unchecking "is$$anonymous$$inematic") OnTriggerEnter2D is then called on both game objects.
This kind of stinks, and seems to be at odds with what is described in the table at the bottom of this article:
http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html
This has been frustrating me, also. $$anonymous$$akes a kinematic rigidbody totally useless and hamstrings the whole 2D engine.
Answer by Runalotski · Jan 20, 2015 at 02:37 PM
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.
Answer by Tomer-Barkan · Nov 19, 2013 at 06:58 AM
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.
I don't see an option to report this from Help->Report a bug. Is there any other way to report this?
And you can contact support via email using: support@unity3d.com.
They did answer me after a few days when I reported another 2d issue (which turned out to be me doing something wrong, but they answered, while my bug post from the editor was not seen yet, as it's still open even though it's obviously not a bug)
I got this reply from support@unity3d.com : "This is not a bug. The RigidBody2D class is not the Same as the RigidBody class. The documentation has not yet been updated and thus can be confusing. According to one of our Developers, the $$anonymous$$inematic Rigidbodies will only collide with other $$anonymous$$inematic Rigidbodies and dynamic and static objects will collide with each other in the 2D system. Dynamic objects can also collide with each other (Rigidbody to Rigidbody). $$anonymous$$ind regards, Unity Support"
Answer by AltProg · May 23, 2014 at 06:03 AM
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.