playMaker

Author Topic: Need help connecting to FSM to send event from C# script  (Read 80 times)

Skyline

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Need help connecting to FSM to send event from C# script
« on: January 06, 2021, 07:14:41 PM »
Hello, I got a plugin from unity asset store, but I don't know how to code.
I thought i'd try using playmaker to connect to the code.
following the advice from another post to send event to fsm directly, I copied this from another post on this forum to send event directly to fsm.
Code: [Select]
GoFsm = GameObject.GetComponent<PlayMakerFSM>();
                GoFsm.SendEvent("TheEvent");
but I don't know if i pasted in the right place. It's not working...Where do I put that code so it fires in this function?

Code: [Select]
    public void DestroyItem(bool showScore = false, bool particles = true, Item explodedItem = null, bool explEffect = false)
        {
            if (!gameObject.activeSelf) return;
            if (square.type == SquareTypes.WireBlock)
            {
                GoFsm = GameObject.GetComponent<PlayMakerFSM>();
                GoFsm.SendEvent("TheEvent");

                square.DestroyBlock();
                StopDestroy();
                return;
            }
« Last Edit: January 07, 2021, 12:32:12 AM by Skyline »