So I just completed the first "Roll-a-ball" tutorial, but when I run the build, the game ball races to the Upper-Left corner even when I don't press any buttons.
I did the obvious stuff (reboot, build again...) but it still does it for the PC stand-alone build, and not when I play directly from Unity.
My code doesn't seem to be different from the tutorial (see link above). Here's the input handling code inside of the "PlayerController.cs":
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
Then I added statements to print the Horizontal and Vertical. When inside the IDE and I play it, they're zero, and when I press an arrow key, they move from 0 to 1 floating point in about a second. In the built stand-alone, Horiz is -1, Vert is 1.
void SetCountText ()
{
countText.text =
"Count: " + count.ToString () + "\n" +
"Horizontal: " + Input.GetAxis("Horizontal").ToString() + "\n" +
"Vertical:" + Input.GetAxis("Vertical").ToString()
;
if (count >= 12) {
winText.text = "YOU WIN!!";
}
}