Hello I need help with this code, I’m trying to get the player to move a set distance forward when I press Q but right now its pretty inconsistent, when I press Q, it will somtimes go straight forward and other times start making me go right or left randomly.
private void Teleport()
{
//if the q key is pressed
//move the transform forward
if (Input.GetKeyDown(KeyCode.Q))
{
transform.position = transform.position + new Vector3(transform.position.x, 2, 0);
Debug.Log("QQQQQ");
}
}