Rigid Body 2D
The Rigid Body 2D component enables you to introduce realistic physics simulations and interactions to 2D objects in your scene. By adjusting the properties of the Rigid Body 2D component, you can control how objects move, respond to external forces, and interact with each other.
For 3D objects, check out the Rigid Body component.
Add a Rigid Body 2D Component
To add a Rigid Body 2D component:
- Go to the Hierarchy panel
- Add or select a 2D object and locate its components in the Inspector panel
- Click Add component
- Go to 2D Physics
- Select Rigid Body 2D
Properties
Property | Description |
---|---|
Mass | Determines the weight of an object and how it interacts with other objects in the physics simulation. Objects with higher mass will have more resistance to external forces and require more force to move or rotate. |
Gravity Scale | The gravity on the object |
Damping | Controls the amount of resistance an object experiences when moving through air or other fluids. Higher damping values cause the object to slow down faster, mimicking increased air resistance or friction. |
Angular Damping | Determines how quickly the object will come to a stop when no external forces are acting on it. Similar to Damping, Angular Damping applies specifically to the object's rotation. Adjusting Angular Damping controls the object's rotational behavior. |
External Force | Allows you to apply a force to the object in a specific direction. This force can simulate effects like wind or other external factors that affect an object's movement. By adjusting the magnitude and direction of the force, you can create realistic physics-based movements. |
External Torque | A force that causes the object to rotate around a specific axis. It is useful for simulating rotational forces, such as a motor turning a wheel or twisting motion. By applying External Torque, you can add dynamic rotational behavior to your objects. |
Velocity | Controls the speed of the object in a given direction |
Angular Velocity | Determines how quickly an object rotates around an axis of rotation and how fast the axis itself changes direction |
Is Static | Determines whether the object is affected by physical forces in the physics simulation. If enabled, the object becomes static and does not respond to external forces. This property is useful when you want to make an object move freely without constraints from the physics simulation. |
Constraint | Restricts movement of the 2D object. The options are:
|