Skip to content

Instantly share code, notes, and snippets.

@cadenburleson
Created February 11, 2017 15:37
Show Gist options
  • Save cadenburleson/84becba9714b46767cbb0a92a05e7452 to your computer and use it in GitHub Desktop.
Save cadenburleson/84becba9714b46767cbb0a92a05e7452 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Move : MonoBehaviour {
public bool xAxis;
public bool yAxis;
public bool zAxis;
public float speed;
// Update is called once per frame
void Update () {
if (xAxis == true) {
transform.Translate (speed * Time.deltaTime,0,0);
}
if (yAxis == true) {
transform.Translate (0,speed * Time.deltaTime,0);
}
if(zAxis == true){
transform.Translate (0,0,speed * Time.deltaTime);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment