Spawning elements in Unity on Button Click

Spawning elements in front of player on Button Click in Unity3D. In this tutorial I am going to show you how to spawn elements in front of player. using UnityEngine; public class SpawnObject : MonoBehaviour { public GameObject cube; void Update () { if (Input.GetKeyDown(KeyCode.Alpha1)) { Instantiate(cube, new Vector3(0, 0, 0), Quaternion.identity); } } } … Continue reading Spawning elements in Unity on Button Click