Hi,
I'm still debugging but I might have a quicker answer from the community
Using Player Prefs XI'm saving a gameobject by the SaveVariable action when the player is dead. When the player dies, I reload the current scene after a timer. The idea is to save a specific GO on a Global Variable (GameObject) when the death event is triggered and to reuse it when the scene is reloaded
.
Using the asset PlayerPrefsEditor, I can see that the key has been saved. For instance, the value of the key is :
{"variableName":"startPoint _PLAYER","objectType":"UnityEngine.GameObject","useVariable":true,"type":3,"floatValue":0.0,"intValue":0,"boolValue":false,"stringValue":"","vector4Value":{"x":0.0,"y":0.0,"z":0.0,"w":0.0},"objectReference":{"instanceID":27526},"arrayValue":{"useVariable":false,"name":"","tooltip":"","showInInspector":false,"networkSync":false,"type":-1,"objectTypeName":"","floatValues":[],"intValues":[],"boolValues":[],"stringValues":[],"vector4Values":[],"objectReferences":[]}}
A couple of breakpoints shows that the GO is saved properly on my Global Variable, but when the level is reloaded, it resets back to
None even though I use a LoadVariable action at the start of the level.
Any idea why ?
Many thanks !
Just a precision - I'm using a Global Gameobject because I'm setting its value (onReloadScene) in another FSMs.