# [C#, 2D] How do I apply force to a player using vector 3 velocity to move

Forgive me if I can’t describe the issue well enough, but I’m trying to use AddForce to ‘boost’ my player forward, but to use addForce i have to suspend my rigidbody’s normal movement code, since they boh use X velocity. The issue is that when my player is done ‘dashing’ they will stop mid air, and not carry the velocity forward.

My regular movement code is

`````` void FixedUpdate()
{
if (isDashing == false)
{
if (isSliding == false)
{
if (touchWall == false)
{
playerBody.gravityScale = 1.5f;
Vector3 moveVelocity = new Vector3(Input.GetAxis("moveX") * (playerSpeed * 50.0f) * Time.fixedDeltaTime, playerBody.velocity.y, 0.0f);
playerBody.velocity =  moveVelocity;

}
if (touchWall == true)
{
playerBody.gravityScale = 0f;
Vector3 moveVelocity = new Vector3(Input.GetAxis("moveX") * (playerSpeed * 50.0f) * Time.fixedDeltaTime, Input.GetAxis("moveY") * (playerSpeed * 50.0f) * Time.fixedDeltaTime, 0.0f);
playerBody.velocity = moveVelocity;

}
}
}

}
``````

My Dashing code is

``````void Dash()
{
if (right == false)
{
turnt = -1;
} else if (right == true)
{
turnt = 1;
}

Vector3 moveVelocity = new Vector3((slideSpeed * 50.0f * turnt) * Time.fixedDeltaTime, playerBody.velocity.y, 0.0f);
playerBody.velocity = moveVelocity;
StartCoroutine("DashW8");
}

IEnumerator DashW8()
{
yield return new WaitForSeconds(slideW8);
isDashing = false;
}
``````

Maybe try using a “maxVelocity” variable and temporarily increase it while dashing. This way you can make your “moveVelocity” higher for a limited time and then decrease it after the duration with out mixing in any Addforce.