Good afternoon everyone!
Next, I'm having a problem. I am developing a game where there is a script called PlayerModel, which when starting the Battle, it comes with data that was pre-defined in the Model script, however, when finishing the battle and trying to access a menu where it has a HUD, I am not able to bring the data (name, level, exp, etc). If I use a GameObject and give it a " gameObject.GetComponent < > () ", considering that it has a player object in Hierarchy, it works. However, if I try to do the same without having the GameObject, whether trying to use the AddComponent () or the GetComponent () , it comes with empty values! Could anyone tell me how to pass parameters, or use static / global parameters effectively?
Edit: another thing is that when I enter the battle, I go out and enter again, it comes back as if it was the first time, it is "resetting" the statuses.
Thank you!