# Improve Performance Tricks

Let's try some tricks to improve performance on when using the Animal Controller and Horse Animset Pro.

## Removing/Disable unnecessary State&#x20;

Remove or disable states NPCs will not use (Fly, Climb, Fall, Jump, Swim). If they are only going to move around (Keeping **Idle** and **Locomotion** will do the trick). This will ignore all the unnecessary Raycasting from automatic States like **Fall** and **Swim** (They are constantly checking if the character is grounded or if there's a water source)

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FOVGh34CAj8xZj6Y17qk5%2Fimage.png?alt=media&#x26;token=0e44caca-c505-4998-950f-f3e41e963ce3" alt="" width="563"><figcaption></figcaption></figure>

## Increasing State Try Loop&#x20;

Changing Loop Cycle of the States..Some automatic states (**Swim**, **Grab Ledge**, **Fall**) are calculated in every frame you can increase the value to skip some frames.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FqkSI60oJshn6jj8u7k0z%2Fimage.png?alt=media&#x26;token=947ff66d-cc86-47b0-a75a-77a329e5335b" alt="" width="563"><figcaption></figcaption></figure>

## Disabling **OnTrigger Enter** - **On Trigger Exit functions**

NPCs should not be using these Unity functions to check if there are any interactions around them. Only the necessary ones should be included. This may drop the performance. This includes things like Zones inside NPCs or the TriggerProxy Component.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FiA0p5LqEotaT4SXNnCZG%2Fimage.png?alt=media&#x26;token=ef7404c3-3456-447a-8bd4-f1aa6cd31540" alt=""><figcaption><p>These Prefabs should be only use for the player.</p></figcaption></figure>

## Sound and Effects

AC does not have any optimized code for Audio clips... I just play an audio clip in an audio source. Unless is really necessary to play audio on an **NPC**,  you can disable the sounds too. This includes the  FootSteps.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F68E9usOfeMIekp59IxdZ%2Fimage.png?alt=media&#x26;token=56216c9a-81e9-437e-8ce1-c8ccc5745783" alt=""><figcaption></figcaption></figure>
