Created
February 11, 2017 15:37
-
-
Save cadenburleson/84becba9714b46767cbb0a92a05e7452 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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