I’m very confused. My script is super long, but ill paste in the bits I think are important.
Everything is in this class
public class Person : MonoBehaviour {
First, I instantiated stuff
public GameObject person;
Person shouldn’t be null, because it is set in unity inspector.
private GameObject spawner;
Spawner shouldn’t be null, because it is set by the script that calls the constructor that builds a new person.
This is the constructor
public Person(int gender, int skinColor, int eyeColor, int hairColor, int hairStyle, int slot0, int slot1, int slot2, int slot3,
int slot4, int slot5, int slot6, int slot7, int slot8, int slot9, int slot10, int slot11, int slot12, int slot13, int slot14, int slot15, GameObject spawner)
Within the constructor, a method is called
setupFailed = buildPerson();
In this method, which returns false if it fails, person is created. The console says its this line where the error is located.
Person_cur = (GameObject)Instantiate(person,spawner.transform.position, spawner.transform.rotation);
Any help?