Behavior tree quickstart guide - bot not returning home

Hi all, I wonder if someone could perhaps assist me with a strange problem I’m having - I’ve followed the behavior tree quickstart guide on this site through all the way and most of it is working perfectly:
https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/

I have one issue in that when the bot loses sight of my character, it does not just stop at my character’s last seen ‘TargetLocation’, it keeps chasing me. It really is very strange because it looks like the values to all of the objects / variables are correct after the bot loses site of my character (TargetToFollow = None, TargetLocation = My last ‘seen’ location, HomeLocation = Never changes). Somehow the AI bot still knows where I am despite the TargetLocation only being set to where it last saw me and I’m out of sight well before it even gets to that location.

I don’t know if it’ll help but during this period of time where it’s magically finding me, the behaviour tree nodes rapidly flash between RapidMoveTo and MoveTo (TargetLocation) as can be seen here:
https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/14/index.html

I re-reviewed everything and I can’t see anything different between what I’ve done and what the guide has instructed me to do.

I can prevent the bot from magically finding me once I’m out of sight by deleting the ‘Moveto (TargetLocation)’ node, but I don’t want to do this because I want the bot to actually go to the point that it actually last saw me at.
This suggests that it’s some sort of issue with that Moveto node, but how could this be?

I’m very confused right now, anyone have any idea what the issue could be? :slight_smile:

Does the behavior stays at the RapidMoveTo task? or it executes it contantly? When the Bot is supposed to be stopped but instead is following you, what task is being executed?

That AIMoveTo node is bothering me. Will that task RapidMoveTo fail after AIMoveTo? maybe it is keeping the behavior stuck.

Sorry I don’t have UE4 installed atm to test it.

On a side note, that tutorial is kinda old so something may have changed. You can tell because it’s not using some new nodes that have been added. It should be using the IsValid node that returns a bool value instead of comparing an object to None. It also should be using the new Event nodes in the Tasks, Decorators, and Service blueprints. EventReceiveExecuteAI instead of EventReceiveExecute will return the AIController and the ControlledPawn instead of only returning the AIController. The same for EventReceiveConditionCheckAI and EventReceiveTickAI. If you are going to get the ControlledPawn of the AIController, use those events instead.

Ok, thanks for the info Ghar - I didn’t realise that the guide was outdated. I’ll see if I can find a more up-to-date tutorial to do this, I’ve tried a few already but there always seems to be some sort of issue with each one I’ve tried.

A long time ago I read here from MieszkoZ himself that AIMoveTo was never intended to be used inside BT tasks. That is why that tutorial has always bothered me lol.

I hope you can actually make it work though.