Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: H3core on March 22, 2013, 10:00:27 PM
-
Hello, im trying to get the fsm to trigger an event from a script attached to the same gameobject, i used the examples from the API reference to no avail.
this is the method im using. Please correct me if im wrong
public PlayMakerFSM FSM1;
FSM1.Fsm.Event("gcol");
It is in c#
Any help would be great
Thnx
Cheers :)
-
Are you using GetComponent<PlayMakerFSM>() to get FSM1?
Is FSM1 in a state that responds to "gcol"?
Are you getting errors?
-
No actually as i stated i was using public PlayMakerFsm to get FSM1.
problem was even though i had declared gcol as a global event i wasnt aware i had to add it as a global transitions as well. Problem solved :)
Thnx for your reply
Cheers :)
-
Glad you got it working :)
Note, you should only use global transitions if you want to respond to that event regardless of the current state. Sometimes it's convenient to test with a global transition, but then later change it to a local transition for more control... But maybe this doesn't apply in your case...