Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Gamecontroller : MonoBehaviour
- {
- public GameObject hazard;
- public Vector3 spawnValues;
- //public in hazardcount;
- void Start()
- {
- SpawnWaves();
- }
- void SpawnWaves()
- {
- Vector3 spawnPosition = new Vector3(Random.Range(-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z);
- Quaternion spawnRotation = Quaternion.identity;
- Instantiate(hazard, spawnPosition, spawnRotation);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment