Created
September 14, 2017 09:56
-
-
Save EdSkamor/80f1eca53cd4a4e403639e607f5ab99d to your computer and use it in GitHub Desktop.
controllin` cube in vertical and horizontal, the script must be in the cube component
This file contains hidden or 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 CubeControll : MonoBehaviour { | |
| private float m_vert; | |
| private float m_horz; | |
| // Use this for initialization | |
| void Start () { | |
| } | |
| // Update is called once per frame | |
| void Update () { | |
| m_vert = Input.GetAxis("Vertical"); | |
| m_horz = Input.GetAxis("Horizontal"); | |
| transform.Translate(m_horz, 0f, m_vert); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment