So since this has been happening for a while to all the unity games that I have bought from steam, where the character would just walk forward and left without my input, I decided to open up Unity Editor and make a scene with a ball in it and make it roll according to the user input, and then I wrote the code to output to the console whether the user is pressing left, right, up or down:
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
string s = "";
if (moveHorizontal == 1)
s += "right";
else if (moveHorizontal == -1)
s += "left";
else
s += "none";
if (moveVertical == 1)
s += ", up";
else if (moveVertical == -1)
s += ", down";
else
s += ", none";
Debug.Log (s);
And sure enough, the Console outputs: “left, up” and the ball rolls forward and to the left whenever I’m not holding any buttons.
I found out that it’s the second Horizontal and Vertical Axes in the input manager that’s causing it, which is the horizontal and vertical axes on a controller.
I have no idea how to solve this problem without disabling those inputs, and also why this is carrying through to any Unity-made steam games that I’ve bought. If anyone could help, that would be great.