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
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
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
MelvMay
Jan 17, 2014 15:05
Isn't the title incorrect? It should say Kinematic colliders don't interact with static colliders. By not adding a rigid-body to "the other cube" it is static. That is "by design" because this is what Box2D imposes. Kinematic only interact with Dynamic.
Regardless, I have recently implemented a change internal to Box2D to allow Kinematic bodies to interact with Static bodies.
KaKaGo
Jan 17, 2014 09:12
Different from 3D.
Document do not tell the difference.
Bad Design.
SpaceMidget75
Jan 15, 2014 13:28
Agree this shouldn't be by design unless Unity can explain why it behaves differently to the 3D behaviour.
PiecesOfLogic
Jan 11, 2014 19:46
I posted this in feedback: http://feedback.unity3d.com/suggestions/2d-kinematic-rigidbodies-must-cause-ontrigger-events
Agreed. This is a huge design flaw that needs to be fixed ASAP.
JonBPS
Jan 10, 2014 10:57
This should be fixed, no idea why this is By Design.
The inconstancy between 2D physics and 3D physics is bad.
jellybit
Dec 25, 2013 05:07
Very confused as to why this is by design. Just try to make a few 2D games and this design choice seems more and more mind-bendingly ridiculous.
GustavoCarvalho
Dec 21, 2013 19:53
Agreed. Make perfect sense kinematics (like a moving platform) to trigger colliders.
littlepolygon
Dec 17, 2013 02:51
@TAK "Kinematic can collide with kinematic. " - this is inaccurate.
littlepolygon
Dec 17, 2013 02:46
By Design = Bad Design!
Kinematic bodies are extremely common for character control. Without triggers, that whole paradigm is bricked.
Tak
Dec 10, 2013 16:41
More information:
"In Box2D kinematic bodies only collide with other kinematic bodies, therefore the second static body doesn't create a contact.
When you change the first body to be dynamic (un-check the IsKinematic property), then it's a dynamic body. Dynamic bodies do collide with static bodies.
Kinematic can collide with kinematic.
Dynamic can collide with static and dynamic.
Static can collide with dynamic.
Box2D imposes this and not Unity."