mellllon

Untitled

May 5th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Gamecontroller : MonoBehaviour
  5. {
  6.     public GameObject hazard;
  7.     public Vector3 spawnValues;
  8.     //public in hazardcount;
  9.  
  10.     void Start()
  11.     {
  12.         SpawnWaves();
  13.     }
  14.  
  15.  
  16.  
  17.     void SpawnWaves()
  18.     {
  19.         Vector3 spawnPosition = new Vector3(Random.Range(-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z);    
  20.         Quaternion spawnRotation = Quaternion.identity;
  21.         Instantiate(hazard, spawnPosition, spawnRotation);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment