Hi.
So far i have not seen this issue yet, what you can try is set a fsm on the player and use a Game Object Is Null and when null do a Debug Log and set it to error (this will pause the game if Error Pause is enabled on the console.
This way you can narrow down on when it happens (just to rule out any issue in the fsms that it gets accidentally removed)
if this triggers and you still can't find you could use it as a fail save to place it back to the global (so if null, place back player to global)
So far it only happened when going from scene B to A?
Hey, thanks for the response.
The issue looks like the one in this post:
https://hutonggames.com/playmakerforum/index.php?topic=13276.0It's the same result but it's not the same problem in our opinion because we don't have the player or the gamemanager in our scenes, we instantiate them at first and don't destroy them when changing scenes. Our game flow is:
1.- We create Player that sets the global variable Player at the Start state.
2.- We go to another scene. The player remains with DontDestroyOnLoad and Start state is not being called
3.- The global variable is still there
4.- We go back to the previous scene. The player remains with DontDestroyOnLoad and Start state is not being called
5.- When the old scene is unloaded the global variable is now set to None (or Missing).
The global reference is lost whenever we go from one scene to another and then back to the first one, no matter which scene is A and which scene is B. It occurs with all of our game scenes.
We know exactly when the reference is lost, we just don't know why. Is it possible that the global variables are reset after a while or something like that?