# How would I make my player controls respond quicker?

I'm working on this game in Unity 2D where the user swipes to make a game object move in the direction that the user swiped in. Currently, when the user swipes it takes about a quarter of a second for the game object to respond and move in the new direction. What should I do to make the controls respond quicker? I know that with Input.GetAxis, I could make it Input.GetAxisRaw to make it more responsive. Right now it's like Input.GetAxis but I'm trying make it like Input.GetAxisRaw. (I can't use Input.GetAxisRaw because this is for a mobile game). Thanks.

private Rigidbody2D rb;
private Vector2 moveVelocity;


in void Update():

if (Mathf.Abs(lp.x - fp.x) > Mathf.Abs(lp.y - fp.y)) {   //If the horizontal movement is greater than the vertical movement...
if ((lp.x > fp.x)) {   //Right swipe
if(moveVelocity != Vector2.left) {
moveVelocity = Vector2.right;
}
}
else {   //Left swipe
if(moveVelocity != Vector2.right) {
moveVelocity = Vector2.left;
}
}
}
else {   //the vertical movement is greater than the horizontal movement
if (lp.y > fp.y) {   //Up swipe
if(moveVelocity != Vector2.down) {
moveVelocity = Vector2.up;
}
}
else {   //Down swipe
if(moveVelocity != Vector2.up) {
moveVelocity = Vector2.down;
}
}
}


And void FixedUpdate():

void FixedUpdate() {
rb.MovePosition(rb.position + moveVelocity * speed * Time.deltaTime);
}

• Please show us your code in context. Chopping out small bits of it like this makes it harder for us to understand what you're doing, since we've never seen the rest of your code before. For instance, we can't see how lp and fp are defined/updated in this code. Mar 22, 2020 at 3:13