Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: vbMeds on January 13, 2018, 09:09:42 AM

Title: Setting FSM Component on 'Send Event' action on a dynamically created gameobject
Post by: vbMeds on January 13, 2018, 09:09:42 AM
I have a Card game object with an FSM, the FSM sends a global event to a 'Board' game objects FSM.

The Card game object is instantiated at run time and as such the FSM Component in 'Send Event' is empty.

Is there a way to automate the process of assigninig the FSM component when instantiating the Card prefab?
Title: Re: Setting FSM Component on 'Send Event' action on a dynamically created gameobject
Post by: djaydino on January 13, 2018, 02:15:54 PM
Hi.
Maybe this video can help you out :

Title: Re: Setting FSM Component on 'Send Event' action on a dynamically created gameobject
Post by: vbMeds on January 14, 2018, 06:59:03 AM
No sadly looks like that's more about setting the FSM component on an instanced prefab, I need to set the FSM component on an action:

(https://i.imgur.com/qluDYRz.png)

I might write an action myself to do it or just grab the action in C# and set it somehow...
Title: Re: Setting FSM Component on 'Send Event' action on a dynamically created gameobject
Post by: djaydino on January 14, 2018, 11:06:18 AM
Hi.
This option will only work if the action and the fsm Component are both in the scene or both on the same prefab.
It is a unity limitation