How to Make Swarm Targets
Last updated
Last updated
This page covers how to use the features of Procedural NPC Crowds in Blueprints.
To add a target besides the player to your swarms, follow these steps:
Make a blueprint actor titled BP_MeatHunk
or whatever you want to name it.
Add the AC_SwarmTarget
component to your BP_MeatHunk
actor.
On begin play or the event when tracking should start, call the Add to Zombie Targets
function from the AC_SwarmTarget
component.
if you destroy or no longer want it to be trackd, call the Remove from zombie targets
function from the AC_SwarmTarget
component.
Thats it, now you can spawn this as a throwable item and the zombies will chase it if its in range. I will tell you how to adjust the range next.
Find the behavior tree folder in the demo content, this may have moved to your main project directory if you went through Getting Setup already.
Open the BT_Zombies behavior tree and click the find swarm target task.
Click the task and adjust the Tracking Max Distance variable in the details panel.
Thats it, the radius for their tracking will now be updated.