#Health
1 messages · Page 1 of 1 (latest)
Its supposed to change the code in the static class
i mean number
ss
heres the class
These are all primitive datatypes, meaning that declaring a new variable on them basically copies their value.
So when PlayerDataStatic.mentalC is false at the beginning at then set to true, HealthSystem would not know about it.
And just like that, HealthSystem wouldn’t know about any changes you do to PlayerDataStatic.
Also, don't abuse static like this. Static means that your field belongs to the type rather than to an object, what definitely is not the case here.
I’m trying to save data from player through scenes without the player being in it. I tried DontDestroyOnLoad and that just didn’t work
I want the data from the player to be changed and saved
Use DontDestroyOnLoad or SceneLoadMode.Additive to load a place above another.
Change the references in your Update() method in HealthSystem to access PlayerDataStatic directly, then try again.
I don’t want to load another scene on top because the skybox and lighting is different in the new scene
Then create a new GameObject, put your PlayerData component on it and then call DontDestroyOnLoad() on it.
I’ll try.. should I erase the static data?
Rename it to PlayerData and remove all static modifiers.