Emerald AI

This page covers the integration of Emerald AI and Game Kit Controller.

What is Emerald AI?

Emerald AI allows developers to quickly create engaging dynamic AI with 100's of AAA quality features, all without having to write a single line of code! Emerald's editor is designed to make creating AI easy, yet incredibly customizable. Emerald caters to all kinds of developers and offers everything users would expect from an all-in-one AI system.

You can find more information about Emerald AI, and its documentation and also purchase it over on the Unity Asset Store.

Inspector Settings

Black Horizon Studios (The maker of Emerald AI) has a tutorial video showing the inspector changes needed to integration Emerald AI and Game Kit Controller.

If you'd rather just get a step by step instructions for the inspector changes you can view these in the tab below labelled "Step by Step Instructions".

Script Changes

Part #1

First you'll need to open the EmeraldAIPlayerDamage.cs script found in the Emerald AI directory Assets/Emerald AI/Scripts/Components/ in your favourite editor and add the following code after the DamagePlayerStandard() method:

/// <summary>
/// Applies damage to a Game Kit Controller controlled player.
/// </summary>
/// <param name="DamageAmount">The amount of damage to deal to the GKC player.</param>
void DamageGameKitController(int DamageAmount, GameObject attacker)
{
    applyDamage.checkToDamageGKCCharacterExternally (DamageAmount,
    gameObject, attacker);
}


Then in the same file, add the following inside the SendPlayerDamage method:

// Send damage to GKC player
GameObject targetObject = null;

if (Target != null){
    targetObject = Target.gameObject;
}

DamageGameKitController(DamageAmount, targetObject);

You can now save the EmeraldAIPlayerDamage.cs script and move onto the next step below.

Part #2

The next part can be done in two ways, the first is the recommended way to add the integration. The second option isn't recommended but can be used if you don't want to use inheritance.

Last updated

Was this helpful?