Created
March 11, 2015 10:56
-
-
Save OutlawGameTools/22f26064bf19193191e2 to your computer and use it in GitHub Desktop.
CS109 - Move a game object using the arrow keys on the keyboard.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
public var speed : float = 10f; | |
function Update () { | |
var move = Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0); | |
transform.position += move * speed * Time.deltaTime; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment