I'm really struggling with the logic of behavior trees

timothy92

New member
I want the AI to seek the player if they can see them or if they are within a small range, so the player can't just get behind them to avoid being sought out by the AI.

1294

1. How do I accomplish this? (View screenshot)
2. Is there any good resources online for understanding the logic of behavior trees (for beginners). I'm a programmer and I am still struggling with the logic of this system, what am I doing wrong?

Any help would be greatly appreciated. Thanks.

EDIT: Also the screenshot button is broken for me (Unity 2019.1), it throws a Tex2D out of range error
 
1. How do I accomplish this? (View screenshot)
If you place a selector above both of those tasks along with a lower priority conditional abort then it'll return true when either task returns success. With your current setup Can See Object has to return success first, and then Within Distance, in order to get to Seek.

2. Is there any good resources online for understanding the logic of behavior trees (for beginners). I'm a programmer and I am still struggling with the logic of this system, what am I doing wrong?
This article is a pretty good overview and especially if you are a programmer it gets into the inner workings of the tree logic: https://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php

EDIT: Also the screenshot button is broken for me (Unity 2019.1), it throws a Tex2D out of range error
Can you send me a repro scene that throws that error? I just tried to take the screenshot in 2019.1 and it worked.

Side topic, but are you PppyMnkyBby on the Asset Store? I think that I just replied to your review :)
 
Seems I wasn't understanding the Selector task properly, thanks Justin.

No I am not PppyMnkyBby, I'm going to wait until I actually learn how to use the asset until I leave a review :)

EDIT: Also, the bug isn't happening anymore, strange..
 
Last edited:
Top