Stop Behavior Tree MoveTo Prematurely

I’ve toiled over this problem for hours today with little result. The simple task I wish to achieve is to interrupt a MoveTo task in a behavior tree before the actor has actually made it to its MoveToGoal. Ive tried using a Decorator, and it does Abort the tree branches below it, but the MoveTo action continues despite the tree branch being deactivated and ignored. I tried to make my own Blueprint Task with the AIMoveTo Blueprint node but that works the same as the Behavior Tree MoveTo node. Lastly I tried to put in my own steering algorithm, which works, and although I have not implemented the interruption mechanics, I realized that my pawn is moving at blazing speeds no matter what I set its Maximum Velocity to be. Looking over the Character Movement Defaults section of the pawn, I realized that the MoveTo must also implement friction algorithms to simulate more realistic speeds of movement.

Now that that wall of text is out of the way, is there a simpler way to do this? Some obscure node I’m overlooking? And if not, please devs, can we have a way to interrupt a MoveTo task in the behavior tree?

If you’re using regular BTTask_MoveTo nodes the actual move request should be aborted as soon as the task is aborted. If it doesn’t work then it’s a bug and I’d love to hear more details regarding the repro steps.

Stripped down project is always the best repro :wink:

Cheers,

–mieszko

This is the tail end of the decorator blueprint, before that is merely casting and retrieval of the State enum from the AIController. It works, but not during a currently executing MoveTo. I also cannot use Finish Abort since this is a Decorator and not a Blueprint Base.

I went back and retried the standard MoveTo with the Decorator: Nothing.

The second one I dont know if it come through clearly but this is a custom task blueprint that I have using the AIMoveTo, which I presume is the same as the MoveTo node in the Behavior Trees, but it still yields the same result.

I have using the AIMoveTo, which I presume is the same as the MoveTo node in the Behavior Trees

No, it’s not. The BTTask_MoveTo is an integral part of BT workflow, while AIMoveTo was never intended to be used inside BT tasks.

Regardless, if you’re using BP-implemented decorators the I must warn you they’re seriously broken before 4.7 - basically don’t implement the flow-observing behavior.

I’d suggest using regular BTTask_Move to and a regular BB-observing decorator that observes a key where you put your go/no-go condition.

Cheers,

–mieszko

Thank you for your help! I figured out a workaround to get the Blackboard Compare Key to work and the NPC is now stopping midstride when the player interacts with it!

Also a bug I found is that the Composite decorator can be applied to a node, but double-clicking it, as it states you should do, does not open it for editing.

Yes, this is fixed in the master branch. Which version are you using? Is this bug in 4.6? If so I need to push for a hotfix for is since it’s a serious issue for BT editor.

Its in promoted.

Thanks for reporting it. I’ve just checked in it turns out it has been fixed not on master branch. I’ve just merged it over. It also turns out it’s in 4.6 as well so I’ll push this as 4.6.1 hotfix.

Thanks guys!

I was struggling with this today and the solution I came up with was to write up my own MoveTowards TASK rather then to use the Moveto.

the issue I had was my Guard would run to my Player and never stop until it reached them. I don’t want my guards being Kite-able so I decided to have them only move “towards” the player.

Here’s the Pic.

Note: This is for a TwinStick Game so the Z isn’t being calculated.