Behaviour tree - look at

So I have a very basic behaviour tree, I’ve only just started learning about them.

My behaviour tree is for an ai companion I have, I want to be able to add a behaviour of looking around for any enemies and if spotted, keep them in their eyesight until something breaks their line of sight…
I’d like them to do this at all times, so during the waiting state, always be looking around while waiting, when following, look behind every now and then walk backwards if necessary, same with move to, if it sees an enemy keep looking at it until line of sight is broken

any help is much appreciated as to how to implement this to what i have currently

Would probably want to do this on the ai controller class rather than the BT. The specifics will depend on which type of detection you’re using, but basically, when the detection event fires successfully, you’d use the Set Focus node on the ai controller to make them lock on to a target. Then when they lose line of sight, you’d use Clear Focus to unlock.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.