Note: This documentation is about writing C# scripts using the LowLevelPhysics2D API. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to 2D physics instead.
Explore the properties you can use to configure a physics body in the Unity Editor. For more information, refer to Create an object with the LowLevelPhysics2D API.
| Property | Description |
|---|---|
| Body Type | Sets how the body behaves in the physics simulation. The options are:
|
| Body Constraints | Places restrictions on the movement and rotation of the body. The options are:
|
| Transform Write Mode | Sets the method Unity uses to copy the position of the physics body to the Transform component on the GameObject. The options are:
|
| Position | Sets the position of the body in world space. |
| Rotation | Sets the rotation of the body in degrees. |
| Linear Velocity | Sets the initial velocity of the body in meters per second. The default is 0. |
| Angular Velocity | Sets the initial rotational velocity of the body in degrees per second. The default is 0. |
| Linear Damping | Sets how quickly the linear velocity decreases, to simulate drag, air resistance, or friction. Low values produce a slower decay rate, so that the body moves faster for longer, like a heavy object. High values produce a faster decay rate, so that the body slows down over a short amount of time, like a lightweight object. The default is 0. |
| Angular Damping | Sets how quickly the angular velocity decreases, to simulate drag, air resistance, or friction. The default is 0. |
| Gravity Scale | Scales the gravity applied to the body. Use a positive value to apply gravity in the same direction, a negative value to reverse gravity, or 0 to apply no gravity. The default is 1, which means gravity isn’t scaled up or down. |
| Sleep Threshold | Sets the speed below which Unity temporarily removes the body from physics calculations to save processor time. The value is in meters per second. The default is 0.05. |
| Fast Rotation Allowed | Removes the limit on how fast a physics body rotates. The limit avoids forces becoming too large and objects passing through each other incorrectly. Enabling this property is recommended only for circular objects. For more information, refer to Move a GameObject. |
| Fast Collisions Allowed | Force continuous collisionA collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a Rigidbody component and is in motion. More info See in Glossary detection for this body. Enable this property for a very fast-moving object that passes through other objects. Enabling this setting can reduce performance. For more information, refer to Configure collisions between LowLevelPhysics2D API objects. |
| Sleeping Allowed | Removes the body from physics calculations when it’s not moving or colliding, to save processor time. The recommended best practice is to leave this property enabled. |
| Awake | Sets the body as awake rather than in the sleep state. |
| Enabled | Removes the body from the physics simulation, but keeps the body and its handles alive. Enabling this property also removes any shapes or jointsA physics component allowing a dynamic connection between Rigidbody components, usually allowing some degree of movement such as a hinge. More info See in Glossary attached to the body from the physics simulation. |