I have a GameObject with my PlayFabLogin script. Whenever I change the scene and go back to the menu, this script is empty and my data does not load. How can I fix it
I try Dontdestroy but it doesn't work
private void OnEnable() { if (PlayFabLogin.PFL == null) { PlayFabLogin.PFL = this; } else { if (PlayFabLogin.PFL != this) { Destroy(this.gameObject); } } DontDestroyOnLoad(this.gameObject); }