How to use Custom Characters and Animations
Last updated
Last updated
This page covers how to use the features of AI Zombie Swarms in Blueprints.
For this example, we will stick with the demo content, but you can use your own character classes. This example comes from a sister plugin called Procedural NPC Crowds, but the logic is the same so I will be sharing parts of it here.
Find the Demo_Content folder and open the Ai Character->Blueprints->BP_AIZombieParent character class.
Ensure you have imported custom skeletal meshes, set their materials in the Skeletal Mesh Editor, and that they share a skeletal rig for animations. Use an animation blueprint made for them. I will not cover making animation blueprints here, as there are a plethora of tutorials on YouTube for this already.
Make a new function or custom event called "randomize character model".
Inside this function or custom event (I will be using a custom event), we need to set the mesh. To do this, create a new variable of type Skeletal Mesh and make it an array
After creating this variable, add the skeletal meshes you want to use. We will separate male and female zombie models so they can have variety. you can also use non zombie characters.
In the Event Graph, copy this code and call the function on Begin Play where the random material was.
That's it, you should now have male and female zombie or swarm characters walking around instead of the mannequin. If you don't want male and female, just remove the random bool branch check.
Important: Updates to the plugin will overwrite the demo content. If you made changes, I recommend moving the demo content to your main project content directory. See for more info on how to do this.