Skip to content

Instantly share code, notes, and snippets.

@kazuooooo
Created January 7, 2015 15:49
Show Gist options
  • Save kazuooooo/a1ba3dc7d52d31d8f3cf to your computer and use it in GitHub Desktop.
Save kazuooooo/a1ba3dc7d52d31d8f3cf to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class KeyCodePra : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey (KeyCode.UpArrow)) {
transform.Translate (transform.forward * 0.1f);
}
if (Input.GetKey (KeyCode.DownArrow)) {
transform.Translate (transform.forward * -0.1f);
}
if (Input.GetKey (KeyCode.RightArrow)) {
transform.Translate (transform.right * 0.1f);
}
if (Input.GetKey (KeyCode.LeftArrow)) {
transform.Translate (transform.right * -0.1f);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment