Setting up an environment query
In this section, you’ll be learning how to add a query to a behavior tree; in particular, we will be tweaking the dummy gunner AI brain in order to let it shoot at a target achieved by an environment query.
Note
As previously mentioned, the EQS is still an experimental feature, so you should use caution if you want to develop a game using it. At the time of writing this book, the EQS is enabled by default by using the Environment Query Editor plugin.
Creating the gym
As a first step, we are going to create a proper gym, so start by doing the following:
- Create a level of your choice, starting from the Level Instances and Packed Level Actors, which I provided in the project template.
- Add a BP_GunnerDummyCharacter instance; just remember to check Use Controller Rotation Yaw so it will be able to rotate and point to the target when prompted to do this.
- Add one or more BP_Target instances so that your AI character will have...