Open sidebar
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SpawnMinions : MonoBehaviour { public Transform node1; public GameObject minionPrefab; bool spawning = true; // Use this for initialization void Start () { StartCoroutine(spawnMinion()); } // Update is called once per frame void Update () { } IEnumerator spawnMinion() { while (spawning) { yield return new WaitForSeconds(0.2f); Instantiate(minionPrefab, node1.transform.position, node1.transform.rotation); yield return new WaitForSeconds(5); } } }
Close sidebar
Back
Please note that all pasted data is publicly available.
Twitter
GitHub
Use setting
Back
Please note that all pasted data is publicly available.
Twitter
GitHub
Use setting