Setting up an AI with Ragdoll Deaths
Ragdolls can be a great way to add dynamic deaths to your AI. Ragdoll deaths allow Unity's physics to drive your AI's deaths so their bodies collapse and react to their surrounding environment similar to games like Skyrim, Oblivion, Halo, etc. When an Emerald AI agent dies, their current animation will automatically blend with the AI's ragdoll physics.
To create a ragdoll on your AI, you will first need to use Unity's Built-in Ragdoll Wizard to create a ragdoll on your AI object. If you haven't already setup your AI through the Emerald AI Setup Manager, it is recommended that you do this first: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Creating-an-AI-through-the-Setup-Manager
If you are unfamiliar with Unity's Ragdoll Wizard, a guide on this can be found here: https://docs.unity3d.com/Manual/wizard-RagdollWizard.html
The Ragdoll Wizard can be opened by going to GameObject>3D Object>Ragdoll within Unity. Assign all needed bone transforms and press Create when you're finished.
After your AI has been through Unity's Ragdoll Wizard, it should look something like the below with colliders and hinge joint components attached to various portions of your AI's bone transforms. There is no need to disable these components as Emerald AI will automatically do this during the runtime initialization process.
Emerald AI now needs to have the appropriate Death Type set in order for it to utilize the ragdoll components that have been assigned. To do this, go to your AI's Emerald AI editor and go to the AI's Settings>Combat>Combat Action tab. Go to the very bottom of this tab until you see the Death Type Setting.
Set this setting to Ragdoll. You can also set what Tag the ragdoll components will use, if desired.
- Version 3.0 Upgrade Guide
- Creating an AI through the Setup Manager
- Setting up an AI's Animations
- Creating Attack Animation Events
- Creating an AI Ability Object
- Applying an AI's Head Transform
- Applying an AI's Ranged Attack Transform
- Setting up an AI's Factions
- Setting up an AI's Layers and Tags
- Using the Combat Text System
- Setting up an AI's Optimization Settings
- Setting up an AI with Ragdoll Deaths
- Creating a Shooter AI
- Creating a Floating or Hovering AI
- Using Emerald AI's Built in Object Pool
- Using the Emerald AI Needs System
- Using Emerald AI with Crux Spawner
- Using Location Based Damage
- Using the Emerald AI Camera Shake System
- Setting up an Equippable and Unequippable Weapon
- Setting up Ranged Weapon Hand IK
- Using the Target Position Modifier
- Using the Built-in IK System
- Setting up Non-AI Targets
- Setting up Custom Damage with Emerald AI
- Using the Sound Detector System
- Setting up the Built in Health Bars and Name Text
- Behaviors and Confidence Levels
- Wander Types and Movement
- Using Factions and Faction Manager
- Detection Type and Target Picking
- Adjusting an AI Hit's Transform
- Enabling an AI's Debugging Tools