continous movement for rigidbody2d using addforce with buttons

public void Moveright(){
RB2D.AddForce (Vector3.right*moveSpeed);
moveVelocity = moveSpeed;
}

this is the code i used to let the object move but the object only moves little by little and i have to continuously press the button…how do i make it move with just pressing the button…

Hi,

Check this link.

try using rigidbody2d.velocity instead because addforce is usually meant for a single push so it seems like that it keeps pushing you each frame velocity is more of continuous movement; hopes this helps.