Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: PolyMad on March 29, 2013, 05:27:49 PM
-
I use EZGUI for text, I have an FSM with a Set Property on which I set the EZGUI text.
Everything works fine, but when I close Unity and reopen it, the connection to the EZGUI object/property is totally lost.
What's going on here?
-
Are you referencing a scene object from a prefab?
-
Yes ::)
And the scene object referenced is a child of a prefab too :-X
-
I managed to overturn the problem and the code is even more clear! ;D
I have moved the SET PROPERTY action INTO the object that must be changed itself, and used the SEND EVENT to activate the state with the SET PROPERTY action!
Am I a genius? :D
-
Yes :D
-
No really, that's the solution and it's ok.
But what if I HAVE TO reference a game object from a prefab?
Not possible?
Can you explain how to use it from prefabs?
-
It's a limitation of Unity. Prefabs cannot save references to scene objects. So you need to find the scene objects at runtime and store them in vairables. You can find by name, tag, child of an object, raycast etc. it depends on the situation...
-
OK, thank you :)