Skip to content

Instantly share code, notes, and snippets.

@sergiobd
Last active September 7, 2018 10:34
Show Gist options
  • Save sergiobd/6954543d0876ad332af8a33a0f635d0f to your computer and use it in GitHub Desktop.
Save sergiobd/6954543d0876ad332af8a33a0f635d0f to your computer and use it in GitHub Desktop.
// For use with the holographic projection tutorial at www.sbromberg.co
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CreateSmallCube : MonoBehaviour {
public Transform cubeParent;
void Update () {
if (Input.GetKeyDown(KeyCode.Space))
{
GameObject smallCube = GameObject.CreatePrimitive(PrimitiveType.Cube);
smallCube.transform.position = transform.position;
smallCube.transform.localScale = 0.1f*Vector3.one;
smallCube.transform.parent = cubeParent;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment