Skip to content

Instantly share code, notes, and snippets.

@gkye
Created November 5, 2016 16:05
Show Gist options
  • Save gkye/42b4750908ed4651e7d33b032cc7b620 to your computer and use it in GitHub Desktop.
Save gkye/42b4750908ed4651e7d33b032cc7b620 to your computer and use it in GitHub Desktop.
//Move Object
public float moveSpeed;
// Use this for initialization
void Start () {
moveSpeed = 1f;
}
// Update is called once per frame
void Update () {
var x = Input.GetAxis("Horizontal2") * moveSpeed;
var vertical = Input.GetAxis("Vertical2") * moveSpeed * Time.deltaTime;
transform.Translate(x * Time.deltaTime,0f,vertical);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment