Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: protozerg on June 14, 2016, 03:37:35 AM
-
Hi,
I'm using Playmaker 1.7.8.4.
Can I send more than one events in the same frame?
Like the code below, I'd like to send two different events from codes.
According to the debugger, I don't think second one is working properly.
Is there another way to send multiple events from codes?
void AFunction()
{
PlayMakerFSM.BroadcastEvent("GlobalEvent1"); // event sent
PlayMakerFSM.BroadcastEvent("GlobalEvent2"); // event not sent
}
-
Hi,
I tested it on 1.8.1 and there it works fine
Make a copy (backup) of your project folder
and update Playmaker to 1.8.1 and try again :)
-
I updated playmaker 1.8.1, but the same problem occurs.
Both "GlobalEvent1" and "GlobalEvent2" are in the same FSM in one game object.
Could it be the problem?
-
Probably the same issue as this link.
http://hutonggames.com/playmakerforum/index.php?topic=11789.msg55100#msg55100
-
hi,
Ah, so you want to trigger 2 events in one fsm in the same frame.
That might be an issue indeed can you make some pictures of what you want to do?
maybe you can make a workaround for it.
-
I moved the event which is not triggered to another FSM in another game object
so I think it works fine now.
Do I have to use only one event in one FSM except START?
-
Do I have to use only one event in one FSM except START?
Hi,
No, I believe your issue was firing two events that are in one state, at the same time.
Basically you can only be in one FSM state at any time- and by sending two events at the same time, you were forcing playmaker to be in 2 different states at the same time, which it can't do.
So you can have as many global events in an FSM as you want, but to fire them, correctly, you need to send each event at a different time/frame. Also bear in mind that the actions in a states that the first global event sends to, also need to finish running before you send a second global event to another bunch of states.
Again, basically just bear in mind the basic principal that; only one state in an FSM can be active at any one time.
Glad you got it all working now!