Quantcast
Channel: Questions in topic: "clone"
Viewing all articles
Browse latest Browse all 508

Infinite Road Clone Duplication

$
0
0
I am making an infinite driving game and created a script to create road forward as the current road is seen. For some reason the roads keep duplicating underneath themselves as well as forward and this crashes the game after only a few minutes, any help you can provide would be much appreciated. public GameObject road; void OnBecameInvisible() { Destroy(gameObject); } void OnBecameVisible() { GameObject e = Instantiate(road, transform.position + transform.up * 15, transform.rotation) as GameObject; }

Viewing all articles
Browse latest Browse all 508

Latest Images

Trending Articles



Latest Images