- Home /
Errors in Editor after Built & Run
Hi everyone,
I'm getting some errors that are beyond my understanding: I can start my Game in Unity Editor without any problems. Everything works fine. But when I built and run it (for windows) some things aren't working anymore. Well there are certain things that can go wrong at this point like missing scenes or #if UNITY_EDITOR or something like that. But the strange thing is: When I exit the game, go back to Unity Editor and start the game over there I'm suddenly getting Out of Range errors that weren't there a second before. And if I restart Unity everything works fine again... only until I try to built and run it...
I narrowed those Out of Range errors down to a single line. But this line works perfectly fine until I Built&Run it.
PartyMemberDatabase database = GameObject.FindGameObjectWithTag("PartyMemberDatabase").GetComponent<PartyMemberDatabase>();
Debug.Log (database);
pmlist.Add(database.partyMember[id]);
The Debug.Log shows me the name of the GameObject. But I can't get any info out of database.partyMember[id]. Well actually I can before building and running it. But not after that. This lines were working for the past few days and I haven't touched them. I have no idea what to do.