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 (42)

  1. 3fe82d7aa727723eb28f560c329329ba?d=mm

    anguaji

    Sep 18, 2014 10:45

    For anyone struggling with this issue (as I was yesterday after grabbing the PSM Unity which is 4.3.4) - setting your rigidbody collider that would normally be kinematic to NOT kinematic (ie physics has an effect on the object) and then setting the gravity scale of that item to 0 (ie physics has an effect but gravity does not cause item to drop) helped me fix my problem. Good luck to anyone with this issue!

  2. 11442e7f66f6c757ee2c61d168948342?d=mm

    ShadowM8

    Aug 26, 2014 01:01

    I know this is old but for our new project we were going to use the 2D tools and this issue is causing a lot of difficulties.

  3. F99bb7a3b7909216f920b76c46c283aa?d=mm

    AronTD

    Jul 07, 2014 22:34

    This is awful.

  4. 28dc922a110f665fbbc5fa2eac2f46be?d=mm

    FireMutant

    Jun 20, 2014 03:59

    2D Physics is useless as long as this issue exists. I'm at a standstill.

  5. 06af8b57a43bc60a01eb1ace2ba7a0ea?d=mm

    Simon Says

    May 24, 2014 22:06

    This just renders the whole 2D physics package unusable, since 3D physics can be used instead and relied upon to behave as expected. Bad design.

  6. Ef2943f045e897ebe36a59651e5eb0e5?d=mm

    KocorJIA3ue

    May 24, 2014 08:45

    Fix it please

  7. 5cccae51a388b9519630e41dfd4411ea?d=mm

    metinevren

    May 17, 2014 01:49

    This is still happening in 4.3.4f1. Please help.

  8. 3a4680c52f8bae491438671a40cdaa0c?d=mm

    Pyrian

    May 12, 2014 14:57

    What's the point of even having a kinematic rigidbody if it still doesn't interact with static colliders? It's barely distinct from a static collider at this point. The documentation suggests that static colliders shouldn't move and if you need to move a collider by script, you should give it a kinematic rigidbody, but that does not work; if you want your object to interact with static colliders, kinematic rigidbodies, or even unmoving non-kinematic rigidbodies, you have to give it a non-kinematic rigidbody and use code to force its position - which is another thing you supposedly shouldn't do.

  9. 1eb72f77c35b1e423c4687b06172b60a?d=mm

    Saxi

    May 09, 2014 15:08

    By design? it should match the 3D functionality and be consistent.

  10. 229a486149a1c645a4f7c78afc2c7f22?d=mm

    Rafes

    May 05, 2014 04:26

    Note. Use at your own risk: With gravity at 0 and the collider set to trigger, it seems to work as I need it to (someone else here mentioned this might work). This may not be a great solution but since I am not moving the object directly (moved by parent) I think it is OK. In the 3D system you should never move a non-kinematic rigidbody using the transform. I have no idea if that is true here. I'm not even sure why it moves with its parent instead of being left behind, but it moves....

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.