Hide and seek AI in Unreal Engine 5: Behavior Tree, EQS, and perception from one prompt
1:38
Hide and seek, built from one prompt. A Behavior Tree, an Environment Query that picks cover, AI Perception so the character can see you, and a mannequin that actually runs and hides. No nodes placed by hand. The useful part is that you spend the time judging the behavior, not wiring the tree.
- 1One prompt asks for hide and seek from scratch: a Behavior Tree, a hiding query, and perception so he can see you. The agent reads its own files, then starts creating the assets. The tree opens empty, just a root. Then it hooks up the AI controller, the perception, the tree, and the query.
- 2It builds the hiding query as a grid of points around the level. It scores them and picks a spot you cannot see, which is how he decides where to run. It builds the hider on a mannequin and assigns the controller.
- 3In play, he sees you and he is gone. The points on the ground are the query looking for cover. Follow him around the wall and he hides. Come closer and he breaks for a new spot. Same loop every time: he sees you, he looks for cover, he hides. That is the loop anyone who has put off EQS because the setup is tedious actually needed.