AddRelativeForce(Vector2, ForceMode2D)
Adds a force to the local space Rigidbody2D.linearVelocity. In other words, the force is applied in the rotated coordinate space of the Rigidbody2D.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
public void AddRelativeForce(Vector2 relativeForce, ForceMode2D mode = ForceMode2D.Force)
Parameters
Components of the force in the X and Y axes.
The method used to apply the specified force.
Remarks
Additional Resources: Rigidbody2D.AddForce, Rigidbody2D.AddForceAtPosition and Rigidbody2D.AddTorque.