Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: evilpikmin on July 04, 2019, 05:42:03 AM
-
Hi all, this has got to be user error but here goes:
I am using Set FSM Vector3 to set a Vector3 variable on a global prefab but the inspector only seems to show me the updated values when I stop my game. All help appreciated!
Cheers
-
I'll reply to myself here and say that Im pretty sure that this is related to prefabs not being set up correctly to reference each other :S
-
Hi.
Prefabs can not communicate directly to scene objects
if you drag in a prefab manually you can drag/drop the scene object to reference into the actions (or use a variable and drop it in there, wich would be a better way to do so) withing the scene.
you will need to do this every time you drag an object from the project window to the hierarchy.
if prefabs are created @ runtime, they need to get a reference 1st to that object.
There are a few ways to do so.
Find game objects would be the easiest but not performance efficient especially if you would use many objects.
another way you can do is :
When creating the object, store it into a variable, then use "Set Fsm Game Object"
Target the created object and set the object you want to communicate with.
Maybe this video can help a bit :
-
Great video! thank you very much. Hopefully I will stop making the same mistake over and over again now :)
Cheers!