Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

relativeForce

Components of the force in the X and Y axes.

The method used to apply the specified force.

Remarks