PlayMaker Help & Tips > PlayMaker Help

How to interrupt a Wait For Completion Action?

(1/1)

Snowfrog:
My FSM has a 'Following Player' state that is the default state. In a script, I detect when the mouse is clicked and I trigger the 'MoveTo' transition event and set the Vec3 target of the mouse. This triggers a transition to the 'Moving To' state (right in the image) that has an action to Start a Behavior Designer Tree. That tree (left in the image) has a simple behavior, it seeks the target then waits for one second.

I have a bit of a conundrum because in order to make sure that Playmaker lets the behavior tree run it's course completely before going back to the 'Following Player' state, I seem to need to tick the 'Wait For Completion' option. The problem is that I want to be able to interrupt this 'Move To' execution if the player clicks somewhere else, effectively giving another 'Move To' order. How should I handle this situation?

Thore:
In the state that waits, you can place other actions that can send events thus leaving to any state you want (e.g. also listen for input). Else you could use a second FSM that listens for input and that sends out an event to the first FSM to go to any state you want.

Navigation

[0] Message Index

Go to full version