float h = Input.GetAxis(“Horizontal”);
float v = Input.GetAxis(“Vertical”);
Vector2 pos = transform.position;
Debug.Log(h);
pos.x += h * Time.deltaTime * speed;
pos.y += v * Time.deltaTime * speed;
transform.position = pos;
I used this code to move the player earlier and it worked fine but now the character moves in right direction without keypress. The Debug.Log(h) shows a value of 1 all the time. I’ve even tried disconnecting my keyboard but the issue still persists. I’m new to unity, anyone please help.,