I'm trying to utilize the send event to game object with FSM Name and event name, but having some issues trying to initialize everything through code.
I need to utilize this in a for each loop for a dynamic number of elements, so I have to do it via custom action.
Here is the code I have so far:
FsmString targetFsmName = new FsmString(); targetFsmName.Value = "Got Hit FSM";
FsmGameObject translationStep1 = new FsmGameObject(); translationStep1.Value = goTheCollidingUnit;
FsmOwnerDefault translationStep2 = new FsmOwnerDefault(); translationStep2.GameObject = translationStep1;
FsmEventTarget theTargetUnitFSM = new FsmEventTarget(); theTargetUnitFSM.gameObject = translationStep2; theTargetUnitFSM.fsmName = targetFsmName;
What am I missing before I can fill all the info I need into:
Fsm.Event(eventTarget, sendEvent);
I think I'm just missing a FSMEvent, but how do I create this via code?
I've attached an example image of exactly what I'm trying to achieve if it were to be done via the Playmaker GUI.