Hi,
It's a common misunderstanding indeed: a scene can be loaded and unloaded during the life time of a game, and if you have a playmaker global variable, you can't reference a gameobject from a scene during editing time, because unity doesn't know if that scene is going to be always loaded.
I too think it's a big short coming, but it's not a PlayMaker issue, it's how Unity was designed. and Regular scripts have the same restriction.
There are two main ways to go about it:
- have a dedicated tag for this gameobject, and then an fsm can search in he loaded scene by tag and get it, store it the global variable. Do that once, don't have every fsm trying to find that gameobject by tag, indeed use a global variable and do it once or when needed udinrg initialision after the scene was loaded.
- have an fsm on that gameobject that set the global variable. Then it saves the trouble of keeping track of scene loading to search for it by tag or name.
be sure in all cases, to always check that the variable is not null, so if an fsm is using that global variable, it has to first check if it's null or not.
Bye,
Jean