playMaker

Author Topic: Setting FSM Component on 'Send Event' action on a dynamically created gameobject  (Read 1672 times)

vbMeds

  • Playmaker Newbie
  • *
  • Posts: 2
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?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi.
Maybe this video can help you out :


vbMeds

  • Playmaker Newbie
  • *
  • Posts: 2
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:



I might write an action myself to do it or just grab the action in C# and set it somehow...

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
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