Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AddRelativeForceX(float, ForceMode2D)

Adds a force to the X component of the _linearVelocity in the local space of the Rigidbody2D only leaving the Y component of the local space _linearVelocity untouched.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public void AddRelativeForceX(float force, ForceMode2D mode = ForceMode2D.Force)

Parameters

force

The force to add to the X component of the Linear Velocity in the local space of the Rigidbody2D.

The method used to apply the specified force.

Remarks