Skip to content

Instantly share code, notes, and snippets.

@EdSkamor
Created September 14, 2017 09:56
Show Gist options
  • Select an option

  • Save EdSkamor/80f1eca53cd4a4e403639e607f5ab99d to your computer and use it in GitHub Desktop.

Select an option

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
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