ConstantForce2D
Applies both linear and angular (torque) forces continuously to the rigidbody each physics update.
Read time 6 minutesLast updated 2 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
- Inherits from: PhysicsUpdateBehaviour2D
[RequireComponent(typeof(Rigidbody2D))]public sealed class ConstantForce2D : PhysicsUpdateBehaviour2D
Remarks
This is equivalent of calling Rigidbody2D.AddForce, Rigidbody2D.AddRelativeForce and Rigidbody2D.AddTorque each physics update.
Additional Resources: Rigidbody2D
Properties
Property | Description |
|---|---|
| force | The linear force applied to the rigidbody each physics update. |
| relativeForce | The linear force, relative to the rigid-body coordinate system, applied each physics update. |
| torque | The torque applied to the rigidbody each physics update. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |