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

how to keep cloning even the real one has destroy c#

$
0
0
i try to make infinite object with clone as enemies. But when the real object has been destroyed, cloning has stop. I try this code to clone the object. using UnityEngine; using System.Collections; public class Spawner : MonoBehaviour { public GameObject enemy; void Start(){ StartCoroutine (EnemySpawn ()); } IEnumerator EnemySpawn(){ while(true) { Instantiate (enemy, transform.position, Quaternion.identity ); yield return new WaitForSeconds(3f); } } }

Viewing all articles
Browse latest Browse all 508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>