Created
September 14, 2017 10:15
-
-
Save EdSkamor/a81f2651007d8f0b6cf6f2f145b6b7ed to your computer and use it in GitHub Desktop.
This same as last but with Rotating Cube
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 CubeControll : MonoBehaviour { | |
private float m_vert; | |
private float m_horz; | |
private float m_rotat; | |
private float mouseX; | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
m_vert = Input.GetAxis("Vertical"); | |
m_horz = Input.GetAxis("Horizontal"); | |
float mouseX = Input.GetAxis("Mouse X"); | |
transform.Rotate(0f, mouseX, 0f); | |
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