How to end a task always in status Running when a higher priority task should be executed?

Federico

New member
InfinitePatrol.PNG

Hello! I am new to the tool and I started playing a little bit with it.
I will explain the scenario I am trying to do in a 2D platformer game:
1) The enemy guard patrols a platform ( basically it goes right and left on a platform , and that's done by my custom task and everything is working fine)
2) When the player comes into sight the guard should run to reach him

I tested also the first sequence and taken alone it works fine (the player is correctly spotted)

Since the standard Patrol class always returns a "RUNNING" status, I did the same thing in my custom class, but my guard just never exit this action even when the player is in sight.
Is there a way to make an override and stop the Patrol task as soon as the first sequence should have success?

Thank you for support,
Federico
 
Top