# General HAP Integration

### **General Integration with a custom Character Controller (Riding only)**

{% embed url="<https://streamable.com/nf3gwl>" %}

If you have your own Character Controller or some 3rd Party Controller from the store you will need to do the following steps:

1. Add the [**MRider** ](/animal-controller/riding/mrider.md)component to your character.

![](/files/k7fa7u5lbvyzqRR167HK)

2\.  If you are using a CUSTOM **Input System** you need to connect **`MRider.MountAnimal()`** to your **Mount Input** and **`MRider.DismountAnimal()`** to your **Dismount Input**.&#x20;

{% hint style="success" %}
If you want to continue using my[ **Malbers Input**](/animal-controller/main-components/malbers-input.md) then use the Context Menu **Create Mount Inputs**.
{% endhint %}

![](/files/YgJoYvf2rBWMj94iMliL)

This will connect the Inputs automatically with the correct methods.

![](https://lh6.googleusercontent.com/8aNw5_KHNM96mPKO4s6pbkHaxF9CRhcjQdNUZjzXfEGTgpVwlpN4mhRjSJBPBGq216h8bpNX3HGA_NbEefnRvzxf4WWXSyJJar3meM2-bIChnyNSgHe_ZY0ZVeIhxwoYHfaCcWB6)

![](https://lh3.googleusercontent.com/C8fy0NxWhSAhvrA60LuP5jIV-bKj4NW7oTlSBf_T8BRdSHr37lhpR4CbS7l2gWBsKJaqma_h2nS-m6W962UdvQ1cNH6SVLmXSnyZkZqQyuyq-FpdEaSFjmPSI-QHjZdnVr0n295o)

3\. If you are using the Riding for mobile then you need to Set the [**Event Listeners**](/animal-controller/scriptable-architecture/scriptables/mevent-listener.md).. This **Events** are used on the Mobile UI and Mobile Input to communicate with the Rider in a non dependent way. Do this with the Context menu **Create Event Listeners** .

![](https://lh6.googleusercontent.com/WAzqmr-tzBS4EAkzKViUAfcVZjuWjekF3I3vwtfzck7BrmtxHqsHMw_MlEbG35h0raFtUrLwZLS5BdZMdzGISool8oGbp1SL-VCD6nnoTnGHP3GZeQjoQc5xcbmUeuKlYUsjSeSs)

{% hint style="info" %}
This will automatically add the [**MEvent Listene**](/animal-controller/scriptable-architecture/scriptables/mevent-listener.md)r component with the [**Events** ](/animal-controller/scriptable-architecture/scriptables/mevents.md)needed for the Rider to communicate with external scripts.
{% endhint %}

![](https://lh4.googleusercontent.com/cfvaOfror9fr4AbNKFT99JlkDD3PlPzPL1zrSaZLKh9NfZH8iyUkpcdB1jIKhUg55zT1LJNINKL1SDPoWnW_RU3c4O_Dc61q-97Y0SKhINv-rN4w8Ya7pimlTRiFZVlOH2ME7kIV)

## Mount UI

To show the "Press Key to Mount" UI you need to add the Mount UI prefab to any canvas you have on your scene

![](/files/jD7MwaPkN4ODyAQwvrMt)

## Mounted Layer

{% hint style="warning" %}
**IMPORTANT:**

Is highly recommended to duplicate your Character Animator First before adding the *Mounted Layer.*
{% endhint %}

4\. Click Add mounted Layer. This will add an extra layer called Mounted and the parameters that the script needs to control the Animator when the character is riding.

{% hint style="danger" %}
The Rider Script must be at the same level as the **Animator Component.** Otherwise, the **Add Mount Layer Button** will not appear.
{% endhint %}

![](/files/oKRojxI6085z4hCLDksI)

{% embed url="<https://streamable.com/32rfti>" %}
Mounted and Rider Combat Layers
{% endembed %}

## Disabling components

5\. On **Disable Components** add the **scripts/components** that interfere with the logic while Riding. (Usually is used for scripts that are not supposed to be active/working while the character is Riding. E.g: scripts that move and rotate the character while is on foot, ragdoll, components that you need to be disabled while riding, etc. Also are used to disable Inputs that are only supposed to be active when the character is not riding: E.g: a Crouch Input).

![](/files/rttLZFWfS5Ob2ikYlybU)

### Custom Link Script

6\. Sometimes you will need to disable functions, change variables values when you are Riding the Animal. The best way to solve this is by creating a new Script to communicate between your controller and the Rider Script. You can take full advantage of the **Rider Events** to let know your character Controller to activate or deactivate behaviours while the character is **Mounting** or **Dismounting** the animal. (Ex: Disabling the Crouch Logic of your controller when the rider starts the **mount** animations; and enabling it back when the character finishes the **dismount** animations).

![](/files/-Lzs8AX9jpwWu57pCeQ1)

\
**And that should be it!.** :grin:&#x20;


---

# 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/annex/integrations/general-hap-integration.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.
