Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Physics Pose component reference

Explore the properties you can use to configure a physics object in the Unity Editor using 2D Physics Core.
Read time 7 minutesLast updated 16 days ago

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 SourceSets 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 WorldAttaches 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 AssetCreates 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 AssetSets 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 TypeSets 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 ConstraintsPlaces 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 ModeSets 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 VelocitySets 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 VelocitySets the initial rotational velocity of the object in degrees per second. The default is 0.
Linear DampingSets 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 DampingSets how quickly the angular velocity decreases, to simulate drag, air resistance, or friction. The default is 0.
Gravity ScaleScales 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 ThresholdSets 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 ThresholdSets 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 AllowedEnables 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 AllowedRemoves 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 AllowedReuses 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 AllowedRemoves 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.
AwakeSets the object as awake rather than in the sleep state.
EnabledRemoves 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 DrawingDraws the object when Unity draws the debug visualization of the world. For more information, refer to Visualize and edit 2D Physics Core scenes.
Mass OverrideSets 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 ConfigurationSets 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 SourceSets the callback method the object calls when it moves or makes contact. The options are:
Callback TargetSets 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

ObjectSets a custom object. Drag any object from the Hierarchy or Project windows to this property, or select the picker (⊙).
Physics MaskSets a custom set of enabled and disabled layers. For more information, refer to Configure collisions between 2D Physics Core objects.
FloatSets a custom floating-point number.
IntSets a custom integer.
Int 64Sets a custom 64-bit integer.
Vector 3 IntSets a custom 3D vector of integers.
BoolSets 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

ValidThe state of the object. True means the object is in the simulation.
WorldThe index number of the world the object belongs to. The default is 0, which is the default world.
IndexThe index number of the object in the world.
GenerationThe number of times Unity has used the same Index for different objects.

Mass Configuration

Property

Description

MassThe mass of the object in kilograms.
Center Of MassThe center of mass of the object in local space.
Rotational InertiaThe 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 UpdateThe number of times Unity sends a callback message to a valid receiving object.

Other properties

Property

Description

AwakeWhether the object is awake or asleep.
Shape CountThe number of shapes attached to this component.
Joint CountThe number of joints attached to this component.
PositionThe position of the object in world space.
RotationThe rotation of the object in world space, in degrees.
Linear VelocityThe linear velocity of the object in meters per second.
Angular VelocityThe angular velocity of the object in degrees per second.

Additional resources