Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class ZombieSpawner : MonoBehaviour
- {
- public GameObject zombie;
- public Transform[] points;
- public float spawnRate = 1;
- private float timer = 0f;
- void Update()
- {
- timer += Time.deltaTime;
- if (timer > spawnRate)
- {
- timer = 0f;
- Instantiate(zombie, points[Random.Range(0,points.Length)].position, Quaternion.identity);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment