Hi,
For a 3d point and click adventure project:
I have an fsm (called player movement) setup for movement from one hotspot to another.
To move
forward from player current hotspot,
a target is selected via mouse left click.
Similarly to move to
previous hotspot,
we press mouse right click to read 'previous hotspot' variable,
and then set that as a
target.
Once a
target is set,
I send that info along with an event (called TweenPlayer) on another fsm (called game manager).
The thing is,
the fsm player movement needs to do more stuff and must continue with a few more actions and then finally return to wait for player input again.
Meaning, the exact state where I send event (TweenPlayer) is (say) sixth state in the player movement fsm. But I have more (seventh, eighth) states ahead.
I need for the TweenPlayer operations in game manager to be finished,
and then only proceed to seventh state.
The Tween operation in game manager is set to 1 sec by default.
Right now the problem is that the right-click and left click can interrupt each other.
Meaning, if the player is moving forward and if we press right-click in less than a sec,
the moving forward gets interrupted midway and starts moving backwards.
I need the tween operation that is in progress to be finished first , then it should be ready to accept new input, such that the ongoing operation doesn't get interrupted.
A temporary work-around I figured was to attach a Wait action of 1 sec on the sixth state right after send event action. 1 sec works because the tween itself is set to 1 sec. But,
Is there a more robust solution something like 'wait until event finished'