Awake() might help!

I was having a problem with the correct Weapon not loading. After saving I would go and pick up a different weapon, then when I tried to load with ‘L’ it still wanted to Load the scene with whatever Weapon I happened to have already on my character, even if it wasn’t the one I saved a moment prior with.

Like Sam pointed out (and luckily I did the full Saving section so I have a better understanding of what it’s doing) I figured it was still getting messed up in the Race. So, switching the Start method out for Awake() fixed the issue. This way, the character would IMMEDIATELY try to load their own weapon that they think they have, and then the Restore() function would get called and load in whatever is stored in the save file. At least, I think that’s the order of operations?

This is definitely helping me to better appreciate the importance of timing things out, and the thought and program-design that has to go into resource loading.

1 Like

That’s correct. Once we introduce the saving system, it becomes much more important to have certain operations happen in their proper place.

Privacy & Terms