Skip to content

Instantly share code, notes, and snippets.

@madigan
Created December 16, 2017 17:54
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 madigan/9638697509fce8e0712e836471f1d9e4 to your computer and use it in GitHub Desktop.
Save madigan/9638697509fce8e0712e836471f1d9e4 to your computer and use it in GitHub Desktop.
Simple controller script for Unity3D (5.x)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
// Update is called once per frame
void Update () {
this.transform.Translate(new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")) * Time.deltaTime);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment