Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2019.1.0a1
2019.1.0b3
2019.2.0a1
Issue ID
1127403
Regression
No
RigidBody 2D with Edge Collider ignores object's mass during a collision
Reproduction steps:
1. Open the attached project named "Case_1127403"
2. Play the Scene
3. Observe the collisions
Expected result: Both heavy triangles turn slowly due to their high mass
Actual result: Heavy triangle with the edge collider turns quickly as if its mass is ignored
Reproducible with: 2017.4.22f1, 2018.3.7f1, 2019.1.0b5, 2019.2.0a7
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
Resolution Note:
EdgeCollider2D produces edges which have no area (they are infinitely thin lines) so don't affect rotational inertia at all, just like triggers. Have a look at the Rigidbody2D in the inspector, specifically the Inertia property and note it'll be set to 1. The rotational inertia of a trigger or collider with no area cannot affect rotational inertia so they add to up zero but because we don't allow zero we set to one.
So whilst 3 edges in the shape of a triangle might be visually the same as a polygon in the shape of a triangle it isn't the same to physics. A polygon has an area as it defines a closed area whereas 3 edges produce an open-shape even if you connect the start/end points therefore have no area.
This comes from the underlying 2D physics engine Box2D.
The user would have to set the rotational inertia in script in this case. https://docs.unity3d.com/ScriptReference/Rigidbody2D-inertia.html
Edges were originally designed in Box2D to be used in static set-ups i.e. they don't move.