Using the Built in IK System
Emerald AI features a built-in IK system that's accessible right from within the Emerald AI Editor. This system allows AI to use IK to look at targets with their heads and bodies while in and out of combat. Emerald AI Agents that use the Emerald IK Type will only use it during combat and if they are using the Ranged Weapon Type.
Note: The Emerald IK Type is only available with Emerald AI 3.0.
All AI that are not in combat will use the Unity IK type, which uses Unity's built-in IK system. AI who use the Melee Weapon Type will also use the Unity IK Type.
First, you will need to ensure your AI's Animation Type for their model is set to Humanoid as this feature is only available for the Humanoid Animation Type. So, this feature will not work for quadrupeds.
To enable the IK feature, go to Detection & Tags>Look At Options within the Emerald AI Editor and set Use Look At to Yes. This will enable the feature and open up more options.
Most of the options are straightforward and have descriptions of their usage right within the Emerald AI Editor. The Head Look Weights control the strength of how much the AI's head is affected by the look at feature. There are options for both non-combat and combat. The same goes for the Body Weights, but control the strength of how much the AI's body is affected by look at feature.
The Emerald IK Type is only used for AI who use a Ranged Weapon, such as a gun or bow. The Emerald IK Type is also only active when a ranged AI is in active combat. When a ranged AI is not in combat, or an AI is melee combat, they will automatically use the Unity IK Type.
AI who use the Emerald IK Type have most settings automated internally. The only setting the user has to worry about within the Look At Options tab is supplying a Bone Object that the Emerald IK Type will control for the IK process.
To add a Bone Object, press the + sign within the Bone Object List then choose the appropriate bone object. A minimum of 1 Bone Object is required (with a maximum of 3) which must by either a Spine or Chest bone.
When using the Emerald IK Type, it is important that you setup your AI's Ranged Attack Transform correctly. For best results, it's recommended that users use an Empty GameObject or a Primitive GameObject (Ensure you remove all colliders from your created Ranged Attack Transform) that is parented to the ranged weapon near its muzzle or where you would like the projectiles to shoot from.
Note: It is very important that the Ranged Attack Transform's local forward position (Blue Arrow) is facing as shown or else the AI may have incorrect aiming. However, most weapons should be correctly modeled to automatically have this and simply setting all rotations to 0,0,0 should suffice.
Lastly, assign the Ranged Attack Transform GameObject as the Emerald AI Ranged Attack Transform located under AI's Settings>Combat>Damage Settings.
- 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