Today I wake up and continue my game. Yesterday everything was normal. But when I reopen the project and Run the game, just for fun, the game fails because the audio don’t starts. That was a little problem, that I “repair” in few minutes. That was running well yesterday, but today just didn’t work. I had to change the way how I get an array of AudioSource, because it appears that it just don’t load in the variable, to return it in a getter, so I tried to find all game objects with tag in the getter, then it worked. I don’t take too importance to that, so I continued. But after hours there were more and more bugs like that. That was as if the start method was not working. No one were loading nothing to the variables in Start().
There are some things that is working and others aren’t.
The new bugs came when I made a new scene to load an object that originally was in the main scene.
Then I had to do the same method with everything. Use the call in the getter, because the variables in Start() does not load or it load but the getter don’t give the object out of the script, except if I use a call. Something like
private static Transform trans;
void Start()
{
transform = GameObject.FindWithTag(“thing”);
}
public static Transform GetTrans()=>trans;
This work well yesterday. Then everything stops to work and work with this:
private static Transform trans;
public static Transform GetTrans()=>GameObject.FindWithTag(“thing”);
Obviously I don’t want to use it. But I don’t know why Unity change it o.o
I updated unity, but it doesn’t work… Help!