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.
BP_MeatHunk
Add the AC_SwarmTarget component to your BP_MeatHunk actor.
AC_SwarmTarget
On begin play or the event when tracking should start, call the Add to Zombie Targets function from the AC_SwarmTarget component.
Add to Zombie Targets
if you destroy or no longer want it to be trackd, call the Remove from zombie targets function from the AC_SwarmTarget component.
Remove from zombie targets
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.
If you can't find the Details panel, go to Window > Details and ensure it's set to true in the top editor toolbar.
Window > Details
top editor toolbar
Thats it, the radius for their tracking will now be updated.
Last updated 8 months ago