# 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="/files/PMjZuTp8wrsDWF99k0GA" 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="/files/yFZdHAugkJhR3wEOieRE" 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="/files/GvQaC58q8hJiKhLMLgpu" 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="/files/EJ0Ae9RcWXs0WONzvamW" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://malbersanimations.gitbook.io/animal-controller/improve-performance-tricks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
