Skip to content

Instantly share code, notes, and snippets.

@OutlawGameTools
Created March 11, 2015 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OutlawGameTools/22f26064bf19193191e2 to your computer and use it in GitHub Desktop.
Save OutlawGameTools/22f26064bf19193191e2 to your computer and use it in GitHub Desktop.
CS109 - Move a game object using the arrow keys on the keyboard.
#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