- Home /
How to add controls? (WASD)
Hello, im very new to unity and i want to know how to add controls into my game, just so i can walk around and look around. Does anyone know the code for this?
Comment
You can add a first person controller component.
Create a cube
Select the cube
Click Component
Select first person controller (you'll find it)
Answer by iwaldrop · Oct 06, 2012 at 05:39 PM
place the following code in your update loop.
if (Input.GetKey(Keycode.A)) Debug.Log ("The A key is being pressed!");
After you get that working look into using the Input Manager to make checking for keys more generic!