Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Enemy Spawn glitch(C#)

$
0
0
i have a very basic enemy spawn script.
Code (CSharp):
  1. public class Zspawn : MonoBehaviour {
  2.  
  3.     public GameObject zombie;
  4.     private Vector3 spawnSpot;
  5.     float delay = 5;
  6.  
  7.     // Use this for initialization
  8.     void Start () {
  9.         spawnSpot = this.transform.position;
  10.     }
  11.    
  12.     // Update is called once per frame
  13.     void Update () {
  14.  
  15.         delay -= 1 * Time.deltaTime;
  16.         if (delay <= 0) {
  17.             GameObject cubeSpawn = (GameObject)Instantiate (zombie, spawnSpot,...
Enemy Spawn glitch(C#)

Viewing all articles
Browse latest Browse all 1466670

Trending Articles