Restart branch on event

Corbs

New member
I have a simple tree setup to give a move command to my gameobject.
HasReceievedEvent gets the command, which sends a position, and triggers the findpath and move along path tasks.

What I need to do is make sure that if HasReceievedEvent hears another command, it will interrupt the other tasks and restart them with the fresh position.
Im not sure if I do this with perform interruption, restart node or something else.

Untitled.png
 
Hi, if you want the left branch to restart if Has Received Event gets the event again, you can change the conditional abort type on the Sequence above to Both, let me know if that works :)
 
Sadly that doesnt seem to work, it no longer moves at all if I set that, we get a brief flash of TaskFindPath then it goes to right branch - idle.
 
Hmm strange, that suggests something is wrong with this Task Find Path task or an external element, but it's hard to say without more info. If you're interested I can offer one screenshare for free to take at your tree and event together 🤓
 
Oh wait, come to think of it, maybe using the Both abort type logically causes that issue if it reevaluates HasReceivedEvent ! After all unless you get the event every frame, it's naturally go from success to failure in the following frame. One possible solution would be to use an Event branch, take a look at the Mario-like Event Branches sample scene.
 
Back
Top