Health Not Saving On Scene Change

So if I manually save my players health it loads back to what it was saved at. The issue is that when I change scenes the health doesn’t stay the same, it always goes up to my default 100. I’ve verified that both unique identifiers on my two levels are set to “player” and the prefab is also set to “player” so I’m just at a loss as to why it’s not saving my players health. Enemies are loading in as they should be, if they’re dead they load in dead. The only thing I can think of is the unique identifier isn’t working properly, but I don’t know what to do to fix this issue.

EDIT:
Nevermind I realized I have a maxhealth parameter and I’m setting my health to maxhealth on start, so changing it to on awake fixed the issue.

There will actually be a lecture later on covering issues caused by using Start() instead of Awake(). Glad you were able to get it sorted!

This topic was automatically closed after 26 hours. New replies are no longer allowed.