Search Issue Tracker

By Design

Votes

24

Found in

4.3.0f4

Issue ID

575251

Regression

No

Rigidbody2d with kinematic rigidbody will not cause OnTriggerEnter2d

Physics2D

-

To reproduce:
1. Create two 2D cubes with colliders 2d
2. Attach a rigidbody 2D to one of the cubes and make the other cube a trigger
3. Attach a script with OnTiggerEnter2D (and some kind of debug message) to the rigidbody cube
4. Enter play mode and move the cube into the other cube - the debug message should get printed
5. Change the rigidbody 2d to kinematic - the debug message is no longer printed, OnTriggerEnter2d is no longer being called

Explanation: kinematic bodies (specifically colliders attached to those bodies) only collide with dynamic bodies.

The allowed collisions for body types are therefore:
Kinematic can collide with Dynamic
Dynamic can collide with Static, Dynamic & Kinematic
Static can collide with Dynamic

Comments (44)

  1. Rafes

    May 05, 2014 04:23

    We publish a product on the assetstore and I was spending my time extending it to the new 2D physics system. This is a blocking issue. It works in 3D physics but not 2D physics. Please fix it.

    Change the design if this is by design. It is obviously not correct for Unity as a whole to have this inconsistency.

  2. Rafes

    May 05, 2014 04:20

    We publish a product on the assetstore and I was spending my time extending it to the new 2D physics system. This is a blocking issue. It works in 3D physics but not 2D physics. Please fix it.

    Change the design if this is by design. It is obviously not correct for Unity as a whole to have this inconsistency.

  3. maros

    Apr 15, 2014 17:09

    Well, whether by design or not, the documentation (https://docs.unity3d.com/Documentation/Manual/Physics.html) states: "With trigger collisions, this restriction doesn't apply and so both kinematic and non-kinematic Rigidbodies will prompt a call to OnTriggerEnter when they enter a trigger collider."

    Please update the documentation.

  4. sun_spider

    Mar 29, 2014 22:24

    There has to be a way to detect 2d collisions WITHOUT physics effects. Please fix. I'm stuck bad.

  5. SrBilyon

    Mar 23, 2014 06:19

    Well, I was pretty sure at first that this was a bug, as I've spend two hours trying to figure out why kinematic rigidbody would never called OnTriggerExit2D. Now I know. This is a bummer that this is by design.

  6. Finch07

    Mar 21, 2014 15:10

    This is an incredibly annoying issue, not sure how this can be by design.

  7. Missile_

    Mar 09, 2014 20:23

    hey guys ! have you tried cancel gravity (Gravity Scale = 0 instead of 1) in rigidbody components? This made my triggers2D work perfectly now. Hope this will help you :-)

  8. Aliyerki

    Mar 04, 2014 21:54

    I can´t work anymore, fix the bug....please

  9. dnaney1978

    Mar 01, 2014 00:30

    Yes this is still an issue. It should work following the unity collision matrix that is used in the 3d system

  10. Jefreestyles

    Feb 26, 2014 03:31

    Rigidbody2d with kinematic rigidbody will not cause OnTriggerEnter2d: Please re-evaluate. The workaround (attaching 3D parented objects, etc.) should only be a TEMPORARY resolution. Please let us know your plans to permanently resolve. Thanks!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.