Open Beafowl-Pull opened 3 weeks ago
_BPWolfCharacter inherits from Character with an AI Controller and Behavior Tree. It represents a wolf.
_BPWolfpack inherits from Actor. It spawns a defined number of wolves and synchronises their behavior through Blackboard keys.
Important: make sure your whole scene is inside a NavMeshBoundsVolume
Go under Content/AnimalVarietyPack/Wolf/Blueprints, drag and drop _BPWolfpack in your scene, where you want the wolves to spawn. You can edit the dispersion (max patrol distance between each wolf) and the quantity of wolves in the pack.
That's all you have to do.
Random patrol: By default, the wolves walk around to random directions. They stay around their leader at a max distance of dispersion parameter.
Player recognition: Each wolf can perceive the player which triggers a shared target for the wolf pack. After a delay of 2 seconds without any perception of the player from any wolf in the pack, back to passive state.
Attack: When player target is set, the wolves run toward the player and turn around him. Each wolf bites the player successively every 2 seconds. If only one wolf remains alive in the pack, he runs away.
Health: Wolves can get hurt. There isn't player attack feature done yet so for now, it happens when the player touches them. When wolf's health is 0, he dies.