playMaker

Author Topic: Sending to FSM from C#  (Read 665 times)

tomraegan

  • Playmaker Newbie
  • *
  • Posts: 14
Sending to FSM from C#
« on: December 29, 2020, 11:31:41 PM »
Ahoy!

Long story, but I'm out of options. Tried lots of things and C# will not bend to my will. I really cannot code.

Now, I know I can BroadcastEvent, and it does work, but it's not the preferred solution.

Can someone please help me send my event to a specific FSM?

Cheers!

Code: [Select]
public GameObject Number;
    public GameObject Playmaker;
    private PlayMakerFSM fsm;


    private void OnTriggerEnter()
    {
        string numberName = Number.name;
       
        if (fsm == null)
        {
            Playmaker = Playmaker.GetComponent<PlayMakerFSM>();
            fsm.SendEvent(numberName);
        }

tomraegan

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Sending to FSM from C#
« Reply #1 on: December 30, 2020, 12:15:58 AM »
This thread had the answer.

https://hutonggames.com/playmakerforum/index.php?topic=20928.0

I've been searching for that answer for a few days, on and off. The magic of posting a thread is the anxiety created that the answer to it lies right in front of your eyes. Some kind of motivation ;)