Skip to content

Instantly share code, notes, and snippets.

@sabotai
Created September 5, 2017 16:18
Show Gist options
  • Save sabotai/237e12d937d0f35b51d91d8eb6aa9316 to your computer and use it in GitHub Desktop.
Save sabotai/237e12d937d0f35b51d91d8eb6aa9316 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Basic3D : MonoBehaviour {
public GameObject mover;
public Vector3 movementAmount;
// Use this for initialization
void Start () {
movementAmount = new Vector3 (1, 0, 0);
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Space)) {
Debug.Log ("true");
mover.transform.position += movementAmount;
} else {
Debug.Log ("false");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment