useAutoMass
Should the total rigid-body Rigidbody2D.mass be automatically calculated from the <see cref= "\> of attached colliders?
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
public bool useAutoMass { get; set; }
Remarks
When false, the explicitly set Rigidbody2D.mass is used for the rigid-body mass. When true, the mass is automatically calculated from all attached Collider2D as a product of their <see cref="Collider2D.density"> and area.
When true, inside the Unity editor, the <see cref="Collider2D.density"> property will appear on any attached Collider2D and the Rigidbody2D.mass property will become read-only.
When false, the Rigidbody2D.mass property can be written to and the <see cref="Collider2D.density"> property is not shown.
Additional Resources: Rigidbody2D.mass, ::Collider2D.density.