Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: zhuxianzhi on August 30, 2017, 05:44:53 AM

Title: How do I get the specified state machine from the PlayMakerFSM?[SOLVED]
Post by: zhuxianzhi on August 30, 2017, 05:44:53 AM
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
    }
Title: Re: How do I get the specified state machine from the PlayMakerFSM?
Post by: Deek 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.
Title: Re: How do I get the specified state machine from the PlayMakerFSM?
Post by: zhuxianzhi on August 31, 2017, 05:43:25 AM
Thank you very much