Roll A BAll

Hey guys,

I am following the tutorial about roll a ball. To move I got this code:

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour 
{
	void FixedUpdate ()
	{
		float MoveHorizontal = Input.GetAxis("Horizontal");
		float MoveVertical = Input.GetAxis("Vertical");

		Vector3 movement = new Vector3 (MoveHorizontal, 0.0f, MoveVertical);

		rigidbody.AddForce (movement);
	}
}

But what does “Horizontal” and “Vertical” means? And how does the game know that that means the arrow keys?

Thanks in advance!

Go to the Edit menu → Project Settings → Input. If you build a standalone PC/OSX/Linux build, there will be a setup screen that appears when the game is first loaded that allows the player to change their keybindings.

See this Unity doc.

That was what I was looking for! very much thanks! :slight_smile: