-
Notifications
You must be signed in to change notification settings - Fork 7
Setting up an Equippable and Unequippable Weapon
Emerald AI features a built-in system that allows an AI to have sheath-able weapons through Animation Events and the game objects attached to their bones. This makes it possible for an AI to have more believable non-combat animation and to show an AI pulling out and putting away their weapons.
Note: Version 3.0 of Emerald AI is required to use this feature.
First, you will need to go to the Animation>Combat tab and enable Use Equip Animations.
Once you have enabled the Use Equip Animation, two additional animation slots will become available. Apply your Equip animation (Pulling the weapon out) to the Equip animation slot and the Unequip animation (Putting the weapon away) to the Unequip animation slot.
Go to the AI's Settings>Items to assign your Sheathed or Holstered Weapon and your Held Hand Weapon.
Your Sheathed or Holstered Weapon should be enabled and parented somewhere on your AI's bone transforms such as their back or side. Ensure that you assign this to the Holstered or Sheathed Weapon Object slot as shown above.
Note: This game object should be enabled.
The Held Weapon Object should be attached to your AI's hand bone transform so that the weapon object follows an AI's animation. This is the object that the AI will use its combat weapon. Note: Every model is different so it is important that the weapon object is placed on the hand bone transform or it will not properly follow an AI's animations. Ensure that you assign this to the Held Weapon Object slot as shown above.
Note: This gameobject should also be disabled as Emerald AI will enable it when it's equipped.
Now, you need to create an animation event that will trigger the enabling or disabling of the specified weapon.
To do this, go your AI's Equip Animation object. Find the frame that the AI should equip their weapon and press the Create Animation Event button. This will create the Animation Event, but you will still need to assign a function name and pass a parameter. For the Function, use EquipWeapon and for the String parameter, use Ranged or Melee (depending on what weapon your AI should be equipping).
This process is similar to the equip animation, but with your AI's Unequip animation and a different function name. Go your AI's Unequip Animation object. Find the frame that the AI should unequip their weapon and press the Create Animation Event button. This will create the Animation Event, but you will still need to assign a function name and pass a parameter. For the Function, use UnequipWeapon and for the String parameter, use Ranged or Melee (depending on what weapon your AI should be unequipping).
Note: The unequip function name should be UnequipWeapon and not EquipWeapon.
Next, you will need to assign an equip and unequip sound for your AI. These will both play automatically when the EquipWeapon and UnequipWeapon Animation Events are called. If you are not using Both Weapon Types, the equippable weapons setup is complete.
If your AI uses both weapon types (both ranged and melee), the process is the same as the guide above, but you would just do these steps for both your ranged and melee attack animations.
- 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