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. Bamboy

    Dec 08, 2013 16:30

    I just spent around 10 hours making something that was relying on OnTriggerEnter2D to function properly. Please fix this ASAP. (+10 votes)

  2. Tortuap

    Dec 07, 2013 23:56

    Agree too. Is it by design because they miss the feature and now they fear about developers complaining about the change ? We wont complain about a change if it helps things to be iso between 2D / 3D and if it makes things easier. Why would I put a rigid body and hacking it to disable the physics for getting collision detection to work ?

  3. MacTwiste

    Dec 05, 2013 18:09

    Why is this marked as By Design?

    It's a pretty common case to have kinematic objects activate triggers. LIke a player entering an area to trigger an event, for instance. Do you advise using 3D collision instead or are there plans to fix this?

  4. Andrige_

    Dec 03, 2013 13:11

    Agreed. My projectile system has stopped working due to this bug.

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.