I'm trying to use a simple code example to move a square object like this:
public GameObject note1;
Vector2 move;
void Update()
{
// move with keyboard
float x = Input.GetAxis("Horizontal");
float y = Input.GetAxis("Vertical");
Debug.Log(x);
Debug.Log(y);
move = new Vector2(x, y);
Debug.Log(move);
note.transform.Translate(move * 1 * Time.deltaTime);
}
I check my configuration in the project settings and input manager:
But I"m confused about three things:
Why do I have 2 declarations for Horizontal and Vertical input?
Why does my Keyboard not move the square, even though I have the config ready and I'm using matching strings in my code?
Why does the
Debug.Logalways report (0, 0)?
