Procedural NPC Crowds Documentation Portal
  • Welcome
  • Getting Started
    • Getting Setup
    • Common Troubleshooting
  • Walkthroughs
    • How to Add to a Custom Level
    • How to Add Interactions
    • How to use Custom Characters and Animations
    • How to Adjust Spawn Amounts
    • Extra Optimizations For NPCs
  • Feedback
    • Feedback Requests
Powered by GitBook
On this page
  1. Walkthroughs

How to use Custom Characters and Animations

PreviousHow to Add InteractionsNextHow to Adjust Spawn Amounts

Last updated 20 days ago

This page covers how to use the features of Procedural NPC Crowds in Blueprints.

IMPORTANT: if you are unfamiliar with the concept of sharing rigs, please watch this video tutorial. https://youtu.be/LBa4aWfD9_4

How to use custom character models and animations:

For this example, we will stick with the demo content, but you can use your own character classes. Just make sure they have an AI detour crowd controller, character movement, and behavior tree running.

  1. Find the Demo_Content folder and open the Pedestrian->Blueprints->BP_Pedestrian character class.

  2. 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.

  3. To randomize character spawns after setting up the character model assets and animations properly, delete the nodes on begin play of BP_Pedestrian to remove the procedural material.

  1. Make a new function or custom event called "randomize character model".

  2. 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

  3. After creating this variable, add the skeletal meshes you want to use. We will separate male and female models so they can have variety.

  1. In the Event Graph, copy this code and call the function on Begin Play where the random material was.

  1. Thats it, you should now have male and female characters walking around instead of the mannequin.

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.