Back to Browse

Unity Instantiate Prefab || Unity 3D Tutorial Spawning Prefabs

440 views
Mar 31, 2020
3:31

Hi In this Unity tutorial, I will show you how to Instantiate Prefab in Unity 3D Here is the script using System.Collections; using System.Collections.Generic; using UnityEngine; public class Spawner : MonoBehaviour { public float repeatRate; public GameObject ballPrefab; void Start(){ StartCoroutine(Spawner()); } public IEnumerator Spawner(){ bool flag = true; while(flag){ Instantiate(ballPrefab, transform.position, transform.rotation); yield return new WaitForSeconds(repeatRate); } } } ▼ SUBSCRIBE OUR CHANNEL▼ https://www.youtube.com/channel/UCWyK... Please Like Share Subscribe Thank You So Much.

Download

0 formats

No download links available.

Unity Instantiate Prefab || Unity 3D Tutorial Spawning Prefabs | NatokHD