Vote count:
0
Hello I have recently used a script from unity found here. http://ift.tt/1Fqco2E The problem is making it so i can rotate the direction the objects from the wave spawner are going in through the inspector in unity as im using it for my frogger project.
using UnityEngine; using System.Collections;
public class GameController : MonoBehaviour {
public GameObject hazard;
public Vector3 spawnValues;
public int hazardCount;
public float spawnWait;
public float startWait;
public float waveWait;
void Start (){
StartCoroutine (SpawnWaves ());
}
IEnumerator SpawnWaves ()
{
yield return new WaitForSeconds (startWait);
while (true)
{
for (int i = 0; i < hazardCount; i++)
{
Vector3 spawnPosition = new Vector3 (Random.Range (-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z);
Quaternion spawnRotation = Quaternion.identity;
Instantiate (hazard, spawnPosition, spawnRotation);
yield return new WaitForSeconds (spawnWait);
}
yield return new WaitForSeconds (waveWait);
}
}
}
asked 1 min ago
How to make a public rotation c# unity
Aucun commentaire:
Enregistrer un commentaire