using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BallEmitter : MonoBehaviour {

    [SerializeField] float InstantiationTimer = 2f;
    public GameObject balls;
	void Start ()
    {
		
	}
	
	// Update is called once per frame
	void Update ()
    {
        CreatePrefab();
	}
    void CreatePrefab()
    {
        InstantiationTimer -= Time.deltaTime;
        if (InstantiationTimer <= 0)
        {
            Instantiate(balls, transform.position, Quaternion.identity);
            InstantiationTimer = Random.Range(1.7f,4);
        }
    }
}
