I have migrated from 3D to 2D physics. The Collision Matrix for 3D Rigidbody interaction is not documented for 2D. This is the matrix for 3D rigidbody. http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html I have come across the following differences between 3D and 2D physics. Would help if somebody could clarify these points. 1) I discovered that if two Kinematic Rigidbodies interact, NO Trigger Events are fired, where as it would work in 3D. Is this intended behaviour or a bug? 2) RigidbodyConstraints for 2D is missing. Why is this not included? 3) Consider this hierarchy, Parent (Rigidbody,No Collider) ---Child (Collider) In 3D System, Physics events are sent to child as well as parent object In 2D System, Physics events are sent to only child object What is the intended behaviour for this scenario? 4) In 3D, A RayCast originating inside a collider, ignores that collider, whereas, in 2D, raycast will hit the collider. what will be the behaviour?
same here, i am novice in unity but same as you i started my project in 3D physics ignoring/locking the Z for a 2D game and switched to real 2D in the new unity version , but there is a lot of stuff that is different or missing, these are the thing i miss - HingeJoint2D.angle does not exist but it does in 3D - HingeJoint2D.motor.motorSpeed exist , but which one is the variable for "Maximum Motor Force" (that's on editor), the script reference in unity website is missing ( http://docs.unity3d.com/Documentation/ScriptReference/HingeJoint2D-motor.html ) anyway i am pleased with the 2D engine, its much more stable than the 3D, just like Box2D and the one inside Corona SDK , rigid bodies won't vibrate like crazy when interact to each other, my project was having awkward behavior all the time on 3D , but now is ok
oh! by the way , for kinematic bodies not colliding , try not setting it to kinematic but gravityScale parameter set to 0
For OnTriggerEnter This message is sent to the trigger collider and the rigidbody (if any) that the trigger collider belongs to, and to the rigidbody (or the collider if there is no rigidbody) that touches the trigger. Note that trigger events are only sent if one of the colliders also has a rigidbody attached. For OnTriggerEnter2D This message is sent only to the trigger collider and the collider that touches the trigger. Trigger events are only sent if one of the colliders also has a rigidbody attached somewhere in the trigger itself or in one of its parent gameobjects.
Continued: 5) Consider the Hierarchy: Parent (Rigidbody, non-Kinematic) ---Child (Rigidbody, isKinematic) In 3D, If Parent Moves, its kinematic children move along with it. In 2D, If Parent Moves, its kinematic rigidbody children don't move along with it. What should be the actual behaviour of the 2D Physics?
I also find the behaviour of rigibody2D.MovePosition() is different from rigibody.MovePosition(). In 3D, apply gravity, but 2D not apply gravity
The above behaviour differences have been resolved in 4.5. There's also a few extra things being added to 4.5 patch releases that resolve the final issues. The MovePosition issue you mention has been fixed and will be in a forthcoming patch release (keep an eye-out for the release notes). A ray/line casts starting inside a collider will have an option to allow you to select whether you want this behaviour or not (to be released as part of the same patch release).