# Emerald AI

A demo scene named <mark style="color:green;">**"USK & Emerald AI"**</mark> is located in the <mark style="color:green;">**(Demo Files/Scenes/Integrations/Emerald AI)**</mark> folder.

**How to activate:**

1. Download the asset and then enable an integration with it in the <mark style="color:orange;">**(Window -> USK -> Integrations Manager -> AI)**</mark>.
2. Add the following code to the <mark style="color:green;">**EmeraldAIPlayerDamage**</mark> script.

```
#if USK_EMERALDAI_INTEGRATION
    DamageUSKCharacter(DamageAmount);
#endif

#if USK_EMERALDAI_INTEGRATION
    void DamageUSKCharacter(int value)
    {
        if (GetComponent<GercStudio.USK.Scripts.Controller>() != null)
            {
                var controller = GetComponent<GercStudio.USK.Scripts.Controller>();
                controller.Damage(value);
            }   
    }
#endif
```

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf4aWZpqUiSipiEh-D6%2Fuploads%2FHFno3uVKw7P6cMgYyj1Q%2FScreenshot%202021-10-03%20at%2002.51.51.png?alt=media\&token=a04d95ba-e4a0-4837-8bed-574a98eab91e)

**How to use:**

1. Follow the Emerald manual to add enemies to the scene, then add a USK character there.&#x20;
2. Make sure your enemies have the correct **Detection Layers.**

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf4aWZpqUiSipiEh-D6%2Fuploads%2FZNgUbBhRCzJ1lGfZCmLr%2Femerald%20layers.png?alt=media\&token=2f6c00e0-558a-4f6d-8426-0c4d0b316865)
