Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Instantiate problem.

$
0
0
I just want ONE object to be created at a spot but it just creates them endlessly, even made unity crash. :D using UnityEngine; using System.Collections; public class Spawning : MonoBehaviour { public GameObject target; Vector3 spawnSpot; bool once = false; void Start() { if(once = !once) { spawnSpot = target.transform.position; Instantiate(transform, spawnSpot, Quaternion.identity); once = true; } } } Thanks in advance.

Viewing all articles
Browse latest Browse all 171066

Trending Articles