I am fairly new to c# and am using a project as a tool to help me learn.
I've been trying to figure out where i'm going wrong with my code, but am struggling. I am trying to instantiate waves at different set spawn points, however I am coming up with the Null Reference Exception and cannot figure out where I am going wrong. All I know is that the issue lies with _sp, but don't know how I can fix it.
public class Wave {
public string spawnName;
public Transform spawnEnemy;
public Transform spawnPoint;
public int spawnCount;
public float spawnRate;
}
static void SpawnEnemy (Transform _enemy) {
Wave wave = new Wave();
Transform _sp = wave.spawnPoint;
Instantiate (_enemy, _sp.position, _sp.rotation);
}
Any help would be appreciated