playMaker

Author Topic: How do I get the specified state machine from the PlayMakerFSM?[SOLVED]  (Read 1438 times)

zhuxianzhi

  • Playmaker Newbie
  • *
  • Posts: 5
GameObject has multiple states, using playMakerFsm.Fsm always the first one that can be obtained in a similar way? For example: playMakerFsm.GetFsm ("name")


Code: [Select]
private void OnTriggerEnter(Collider other)
    {
        var playMakerFsm = other.GetComponent<PlayMakerFSM>();
//        playMakerFsm.Fsm
    }
« Last Edit: September 01, 2017, 07:19:59 AM by jeanfabre »

Deek

  • Full Member
  • ***
  • Posts: 133
Re: How do I get the specified state machine from the PlayMakerFSM?
« Reply #1 on: August 30, 2017, 07:55:53 AM »
Use
Code: [Select]
var playMakerFsm = PlayMakerFSM.FindFsmOnGameObject(other, "name");
where "name" is the name of the FSM and 'other' is the GameObject with the FSM you want to retrieve.

zhuxianzhi

  • Playmaker Newbie
  • *
  • Posts: 5
Re: How do I get the specified state machine from the PlayMakerFSM?
« Reply #2 on: August 31, 2017, 05:43:25 AM »
Thank you very much