Method in Start() not running, but in Update(), why?

Hey, im currently at building an automatic save and load system. On the Editor in Unity its all working well. But for some reason if i start the Game on my Phone, the loading of my inventory works, but the Player position does not. Even if i do the exact same thing with the data, and how i save and load it.

For test purposes i run the “LoadPlayer()” method in Update once, and like this it is working. It really confuses me that it is working like this:

void FixedUpdate()
    {
        if(!loadedPos){
            LoadPlayer();
            loadedPos = true;
        }
    }

but not like this:

void Start(){
        LoadPlayer();
        ...
}

Does anyone have an idea what could cause that?

my inventory is loading in the second way btw.

Thanks for every help!

To my understanding:

The reason why “FixedUpdate” worked, and not “Start” is because “FixedUpdate” are called for every “Physics Step”. Meaning it happens after “Start”.

The problem is probably with “LoadPlayer();”, this method has to be run after another method, and “Start” is too early.

To test this theory try this:

    private void Awake()
    {
        StartCoroutine(loadPlayerDelayed());
    }

    IEnumerator loadPlayerDelayed()
    {
        yield return new WaitForSeconds(0.1f);
        LoadPlayer();
        Debug.Log("PlayerLoaded");
    }

If is there any exception occur in Awake() function then Start() function will not call. Make sure there is not any exception in Awake() function.:slight_smile:

If is there any exception occur in Awake() function then Start() function will not call. Make sure there is not any exception in Awake() function.:slight_smile: