I want to set a GameObject as a global variable via script, in order to use it in another scene. I have created the variable from the Variables menu in the Editor, but the AC.GlobalVariables class has set methods only for Boolean, Float etc, not for GameObject. Am I missing something?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I eventually figured out a way:
AC.GlobalVariables.GetVariable("varname").GameObjectValue = myGameObject;
I don't know if it's optimal, but it works...
Yes, that's it.
You can optimise it by storing a reference to the variable, but it'd be a minimal difference unless you're setting it every frame: