Version: Unity 6.7 Beta (6000.7)
Language : English
Visualize and edit 2D Physics Core scenes
Physics Area Capsule component reference

Physics Pose component reference

Explore the properties you can use to configure a Physics Pose component in a 2D Physics Core object. For more information, refer to Add physics to a GameObject with 2D Physics Core.

Note: This documentation is about using Pose, Area, and Constraint components. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to 2D physics instead.

Simulation

Property Description
Simulation Source Sets the simulation world the object belongs to. The properties of the world affect the object’s movement. The options are:
  • Default World: Assigns the object to the default world, which Unity creates automatically.
  • Simulation World: Assigns the object to the custom world you set in the Simulation World property below.
Simulation World Attaches the object to a different simulation world than the default world. Drag a Physics Simulation World asset from the Project window to this property, or select the picker (). This property is available only if you set Simulation Source to Simulation World.
Make Asset Creates a Physics Simulation World asset for you to save, then assigns it to the Simulation World property. This property is available only if you set Simulation Source to Simulation World.

Definition

Property Description
Definition Asset Sets an asset that sets the values of the properties in this section. By default, this property is empty, and Unity stores the values inside the component. To set a definition asset, drag a Physics Pose Definition asset from the Project window to this property, or select the picker (). For more information, refer to Configure 2D Physics Core scenes with definitions.
Body Type Sets how the object behaves in the physics simulation. The options are:
  • Dynamic: The object has mass. Unity applies forces, collisions, and gravity to the object.
  • Kinematic: Unity applies no forces or gravity, but allows collisions with Dynamic bodies. Kinematic bodies move only when you manually reposition them or set their velocity.
  • Static: Unity applies no forces or gravity, but allows collisions with Dynamic bodies.
Body Constraints Places restrictions on the movement and rotation of the object. The options are:
  • None: Allows the object to move and rotate freely.
  • Position X: Stops the object moving along the x-axis.
  • Position Y: Stops the object moving along the y-axis.
  • Rotation: Stops the object rotating around the z-axis.
  • Position: Stops the object moving along both the x-axis and the y-axis.
  • All: Stops the object moving or rotating.
Transform Write Mode Sets the method Unity uses to copy the position of the physics object to the Transform component on the GameObject. The options are:
  • Current: Copies the position and rotation at the end of the physics update.
  • Interpolate: Copies the position and rotation interpolated between the previous state and the current state.
  • Extrapolate: Copies the next position and rotation, extrapolated from the current position, rotation, and velocities.
  • Off: Doesn’t copy the position or rotation.
Linear Velocity Sets the initial velocity of the object in meters per second. The options are:
  • X: Sets the initial velocity along the x-axis.
  • Y: Sets the initial velocity along the y-axis.
Angular Velocity Sets the initial rotational velocity of the object 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 object moves faster for longer, like a heavy object. High values produce a faster decay rate, so that the object 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 object. 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 object from physics calculations to save processor time. The value is in meters per second. The default is 0.05.
Collision Threshold Sets the distance an object must travel in one frame to trigger Unity using continuous collision detection, as a proportion of the size of all the pose’s shapes. Continuous collision detection prevents fast-moving objects from passing through other objects, but might reduce performance significantly.

Use a lower value to stop more objects passing through other objects. The default is 0.5. Use a value of 0 to enable continuous collision detection at all times.
Fast Collisions Allowed Enables more frequent collision detection, to avoid the object passing through other objects if it moves very fast. Enabling this setting can reduce performance. For more information, refer to Configure collisions between 2D Physics Core objects.
Fast Rotation Allowed Removes the limit on how fast a physics object rotates. The limit avoids forces becoming too large and objects passing through each other incorrectly. Enabling this property is recommended only for circular objects.
Contact Recycling Allowed Reuses the points where two objects collide if the objects move only slightly, instead of recalculating the points every frame. Disable this property to make sure incorrect collisions don’t occur after the objects move apart. Disabling the property might reduce performance.
Sleeping Allowed Removes the object 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 object as awake rather than in the sleep state.
Enabled Removes the object from the physics simulation, but keeps the object and its handles alive. Disabling this property also removes any areas or constraints attached to the object from the physics simulation.
World Drawing Draws the object when Unity draws the debug visualization of the world. For more information, refer to Visualize and edit 2D Physics Core scenes.
Mass Override Sets which properties Unity overrides with the values you set Mass Configuration to. The options are:
  • Mass: Overrides the mass of the object with the Mass value.
  • Rotational Inertia: Overrides the rotational inertia of the object with the Rotational Inertia value.
  • Center Of Mass: Overrides the center of mass with the Center value.
Mass Configuration Sets the mass, center of mass, and rotational inertia of the object. Unity uses the values only if you set Mass Override to the corresponding property. The properties are:
  • Mass: The mass of the object in kilograms.
  • Center: The center of mass of the object in local space.
  • Rotational Inertia: The rotational inertia of the object in kilograms per square meter.

Callbacks

Property Description
Callback Source Sets the callback method the object calls when it moves or makes contact. The options are:
Callback Target Sets the object that receives physics callbacks. This property is available only if you set Callback Source to Pose or Bodies.

Event settings

The properties in this section set the specific method this object calls or the parameter it sets, and control the behavior of the On Body Update (BodyUpdateEvent) method of the component. This section is available only if you set Callback Source to Events.

For more information, refer to Inspector-configurable custom events.

User Data

Use the properties in this section to add your own data to the component, and read it using the U2D.Physics API. For more information, refer to Add custom data to a 2D Physics Core object.

Property Description
Object Sets a custom object. Drag any object from the Hierarchy or Project windows to this property, or select the picker ().
Physics Mask Sets a custom set of enabled and disabled layers. For more information, refer to Configure collisions between 2D Physics Core objects.
Float Sets a custom floating-point number.
Int Sets a custom integer.
Int 64 Sets a custom 64-bit integer.
Vector 3 Int Sets a custom 3D vector of integers.
Bool Sets a custom Boolean value.

Info

This section displays information about the physics object. You can’t directly edit the properties in this section.

Handle

Property Description
Valid The state of the object. True means the object is in the simulation.
World The index number of the world the object belongs to. The default is 0, which is the default world.
Index The index number of the object in the world.
Generation The number of times Unity has used the same Index for different objects.

Mass Configuration

Property Description
Mass The mass of the object in kilograms.
Center Of Mass The center of mass of the object in local space.
Rotational Inertia The rotational inertia of the object in kilograms per square meter.

Callbacks

This section is visible only if you set Callback Source to a value other than Off.

Property Description
Body Update The number of times Unity sends a callback message to a valid receiving object.

Other properties

Property Description
Awake Whether the object is awake or asleep.
Shape Count The number of shapes attached to this component.
Joint Count The number of joints attached to this component.
Position The position of the object in world space.
Rotation The rotation of the object in world space, in degrees.
Linear Velocity The linear velocity of the object in meters per second.
Angular Velocity The angular velocity of the object in degrees per second.

Additional resources

Visualize and edit 2D Physics Core scenes
Physics Area Capsule component reference