playMaker

Author Topic: [SOLVED] Trying to disable an FSM with Script...  (Read 1691 times)

speccy666

  • Playmaker Newbie
  • *
  • Posts: 8
[SOLVED] Trying to disable an FSM with Script...
« on: January 20, 2016, 02:39:11 PM »
I suppose this is quite easy for experts... I cannot manage how to disable or enable a FSM from Java script  like : "ObjetFSM.Fsm.enabled=false;"

I tried this but it does not work :
Code: [Select]
    var ObjetFSM : PlayMakerFSM;
    //Surveille l'état des FSM et controle le projet en fonction des clicks utilisateurs
    //Si Porte choisie alors on désactive les autres portes.
   if (ChoixPorte==1)
    {
        // on trouve le FSM sur l'objet en cherchant l'objet et en l'attribuant à une variable déclarée en PlaymakerFSM
        ObjetFSM = gameObject.Find("porte2").GetComponent.<PlayMakerFSM>();
        //On agit sur l'objet
        ObjetFSM.Fsm.enabled=false;
    }
    print(ChoixPorte);
}

Thanks.
« Last Edit: January 20, 2016, 02:51:08 PM by speccy666 »

speccy666

  • Playmaker Newbie
  • *
  • Posts: 8
Re: [SOLVED] Trying to disable an FSM with Script...
« Reply #1 on: January 20, 2016, 02:52:17 PM »
OK after a hard struggle, I found this really simple :
Instead of :

        ObjetFSM.Fsm.enabled=false;

You type :

        ObjetFSM.enabled=false;