# AddForceX(float, ForceMode2D)

> Adds a force to the X component of the Rigidbody2D.linearVelocity only leaving the Y component of the world space Rigidbody2D.linearVelocity untouched.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public void AddForceX(float force, ForceMode2D mode = ForceMode2D.Force)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The force to add to the X component of the Linear Velocity in the world space of the [Rigidbody2D](/engine/6000.0/script-reference/unityengine/rigidbody2d.md).**** (\[ForceMode2D]\(/engine/6000.0/script-reference/unityengine/forcemode2d)): The method used to apply the specified force.

### Remarks

Additional Resources: [Rigidbody2D.AddForceY](/engine/6000.0/script-reference/unityengine/rigidbody2d/addforcey.md) and [Rigidbody2D.AddForce](/engine/6000.0/script-reference/unityengine/rigidbody2d/addforce.md).
