# Ootii's Motion Controller

## Asset Location

{% hint style="info" %}

## [**Motion Controller**](https://assetstore.unity.com/packages/templates/systems/third-person-motion-controller-15672?aid=1100lHT6) **|** [**Sword Pack**](https://assetstore.unity.com/packages/templates/systems/sword-shield-motion-pack-77196?aid=1100lHT6) **|** [**Archery Pack**](https://assetstore.unity.com/packages/templates/systems/archery-motion-pack-70487?aid=1100lHT6) **|** [**Camera Ctrl**](https://assetstore.unity.com/packages/tools/camera/camera-controller-13768?aid=1100lHT6)

{% endhint %}

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0PxXkMX2FttQJTNAID%2F-M0Pz8ga5-ZLXizxTfLY%2Fimage.png?alt=media\&token=09b17c95-c067-48fe-96df-8024e0235e6d)

{% hint style="info" %}

### Remember to have the packages on your project installed correctly

{% endhint %}

## **Install the Integration Package**

**1.-** Download from the [**Integration Drive Folder**](https://bit.ly/MalbersIntegrations) the package **HAP (4.0.5) Ootii Motion Controller (2.805)**

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TlWyEqn00DvrztemN%2F-M0TloxG4OSequLwdI-R%2Fimage.png?alt=media\&token=420b0b70-1a51-442d-8638-7abcdb5219bb)

\
**2.-** Install/Drop the **unitypackage** to your project.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TnBy-UfB-01SN-S6_%2F-M0TnO1LA1XqIgPFg-os%2Fimage.png?alt=media\&token=d48892bb-bf12-44be-acf8-869a22c5dd96)

{% hint style="info" %}
You can test the Integrations **Demo Scenes** on the Integration Folder
{% endhint %}

`Malbers Animations/Horse AnimSet Pro/Integrations/Ootii`

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TmimJexfVrIUb5g8_%2F-M0Tn0zhKB7M0aSpP7q-%2Fimage.png?alt=media\&token=10d783a6-3078-4849-ab59-f1d626ed40db)

## Integration Steps&#x20;

To create a new integration from scratch you need to do following steps..&#x20;

{% hint style="warning" %}
These steps are also included for the **Sword and Shield** the **Archery pack.**
{% endhint %}

**1.-**   Open any Scene with a Character already Set with the Motion Controller. For this example let's do it with the scene: demo\_Attributes

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TnrMs83hbuRdU9lak%2F-M0ToejGwyj88CsC1Z_C%2Fimage.png?alt=media\&token=3dcb5321-ab02-4d3e-814c-64e344328bbc)

**2.-** Drag to the opened scene the **Horse Realistic** Prefab. Find it using the Search Bar on the Project window

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TnrMs83hbuRdU9lak%2F-M0Tp3iEkw9tIocY760b%2Fimage.png?alt=media\&token=050779cd-bbf4-493f-bdb8-bc62ec53eb12)

**3.-** Select the Character with the Motion Controller Component:

**4.-**  Select the Animator Controller on the Animator Component. On the Project window duplicate it using Ctrl+D, and replace the old animator with the new one.

![This will avoid overwriting the Animator with new updates](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TnrMs83hbuRdU9lak%2F-M0TpiB8f_18CQNPH1j0%2FwKSd5PeNEc.gif?alt=media\&token=32ac0bfa-db92-4a28-b6c9-8773fb031434)

### **\<Rider Component>**

**5.-**  Add the **MRider** script to your  Character controller.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TqAAEfuer8mN9xVfr%2F-M0TqYsIch2XulhKPuBg%2FgCPn1g3mwF.gif?alt=media\&token=7ed7246c-4353-495b-a5b2-bfee188cb7d1)

**6.-** Click the Button **Add Mounted Layer**

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TqAAEfuer8mN9xVfr%2F-M0TqppWOejRHBoL1uy-%2Fimage.png?alt=media\&token=564d7ab3-bad2-4541-83f0-d9c2113a4535)

This will add a new Layer and new Parameters to the Animator Controller

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TqAAEfuer8mN9xVfr%2F-M0Tr1eBMHyt8eLkNrnx%2Fimage.png?alt=media\&token=af8f1320-f0be-45a8-9fad-a2cac3472e51)

**7.-**  If you are using a "Custom Input System"  you'll need to connect [**MRider.MountAnimal()**](https://malbersanimations.gitbook.io/animal-controller/riding/mrider/rider-mp#void-mountanimal) to your *Mount* Input, and [**MRider.DismountAnimal()**](https://malbersanimations.gitbook.io/animal-controller/riding/mrider/rider-mp#void-dismountanimal) to your *Dismount* Input. If you want to continue using my Malbers Input then use the Context Menu Create Mount Inputs.&#x20;

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TqAAEfuer8mN9xVfr%2F-M0TsWMjhUbXkjyMU9hj%2Fimage.png?alt=media\&token=52716599-f1e6-4c89-834d-4375369bd128)

This will create a [**MInput** ](https://malbersanimations.gitbook.io/animal-controller/main-components/malbers-input)component with 3 Inputs for the Rider (Mount, Dismount and Call Mount); and connect the events of the inputs to the proper methods.&#x20;

You can change the *Type* from **Key** to **Input** and add those Inputs to the [Unity Input Manager.](https://docs.unity3d.com/Manual/class-InputManager.html)

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

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

**8.-**   Create the [**Event Listener** ](https://malbersanimations.gitbook.io/animal-controller/scriptable-architecture/scriptables/mevent-listener)by using the Context menu "Create Event Listeners".

This will automatically add the [**MEvent Listener**](https://malbersanimations.gitbook.io/animal-controller/scriptable-architecture/scriptables/mevent-listener) component with the Events needed for the Rider to communicate with external scripts in a non-dependant way.

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

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

**9.-**  On [**Disable Components**](https://malbersanimations.gitbook.io/animal-controller/riding/mrider#disable-components-and-disable-list) add the scripts that interfere with the logic while riding. (Usually is used for scripts that are not supposed to be active while the character is Riding. Like scripts that move and rotate the character, Ragdoll scripts, etc. Also are used to disable Inputs that are only supposed to be active when the character is not riding: Ex: a Crouch Input).&#x20;

{% hint style="success" %}
In Case of Otti's MC the **Actor Controller** is in charge of moving the character .. so we need to **disable** it
{% endhint %}

### \<UI>

**9.-**   Add the **Mount UI** prefab to any UI Canvas. Find it using the Search bar on the project window

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0Tt9GeA0FFjnCwa2HP%2F-M0Tu02wEQqvp3XxiySj%2Ft1H1Sbuvnx.gif?alt=media\&token=0049b936-635d-41ea-b906-189e53fc732a)

{% hint style="info" %}
The **Mount UI** notifies you when you can press the **Mount** and **Dismount** Inputs&#x20;
{% endhint %}

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0T1Y-ZlTpa3Xnxltn_%2F-M0T7H6gYw1GzLvHpFch%2FAwWLcu6r94.gif?alt=media\&token=db0fa6b1-1784-41c8-b978-9933030c165a)

**10.-**   If you like you can also add to the UI canvas the **Slider Stamina** prefab and the **Slider Health** prefab to check the **health** and **stamina** of the horse.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0Tt9GeA0FFjnCwa2HP%2F-M0TuUYGdye1byFX0udK%2Fimage.png?alt=media\&token=cf5cebf6-c8d4-4c91-bcca-aa02db7f2f23)

**11.**- On the **Actor Controller** -> Collision group: Set the Animal as a collision Layer too.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0Tt9GeA0FFjnCwa2HP%2F-M0Tv2DMSj1ZNFyaGMCN%2Fimage.png?alt=media\&token=d42cf97d-4969-4fde-befe-0c97c42467e1)

### **\<Link Script>**

{% hint style="success" %}
The Link script is the bridge between the Rider Component and Ootii's MC. Allows the Rider to communicate with the core Character Controller components. Disable features via code while the character is riding the animals and enabling them back when the character is back on foot
{% endhint %}

**12.-**   Add the Invector **HAP Link** script to the Character.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0Tt9GeA0FFjnCwa2HP%2F-M0TunWVova-MvpSgJUB%2Fimage.png?alt=media\&token=7217a0d9-f240-4aa7-bdc7-7d7165f1a605)

**13.-**   Set on the Ootii Camera parameter:  the current Camera Controller on the Scene

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0Tt9GeA0FFjnCwa2HP%2F-M0Tvg-XDRZiGJle7UxP%2FUeS05gJgve.gif?alt=media\&token=9ffd4d25-2127-4148-aa24-c663ba59b6ed)

## Sword and Shield Pack

{% hint style="danger" %}

### **IMPORTANT:**

Please follow first the[ **Quick Guide**](http://www.ootii.com/Unity/MotionControllerPacks/SwordShield/SwordShieldUsersGuide.pdf) on how to Install the Mixamo Animations for the S**word @ Shield** pack . Then come back here:)
{% endhint %}

In case of the Sword and Shield Pack.. on your character Controller change the **Sword\_01** for **Sword\_01\_HAP**

* Select your Character
* Go to the **Basic Inventory** Component and Select Items -> Sword and Find the **Sword\_01\_HAP**

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0_MVnkWDrp9h_Bn1_8%2F-M0_MnlJQlvOC__fTGHi%2Fimage.png?alt=media\&token=8398fd51-2592-4b5e-a100-b902e29575fa)

This sword has already attached to it the **MWeapon** Component, which allows the Riding Combat System to recognize that it can use the sword while mounting.

**1.-** Add the Rider Combat Component

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0TxQyVlUX6ZwaBLUUT%2F-M0Txl2RxeAG3sYubIPp%2Fimage.png?alt=media\&token=883c94fe-83ed-4bbb-b5d3-d672b881f7c1)

**2.-**  Click **Add Rider Combat Layers**

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0U22B0jHiLwKpmHs6Q%2F-M0U2xAU_AW5QemnfIEG%2FUnity_OWferoRtl9.png?alt=media\&token=b05a1fa0-06de-4d4a-a1a8-6bd69fbe25c9)

{% hint style="success" %}
This will add new Layers and new Parameters to the Animator Controller
{% endhint %}

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0U22B0jHiLwKpmHs6Q%2F-M0U3RTKwqLss-IMQdXF%2Fimage.png?alt=media\&token=55ce6371-0b72-40aa-8d39-faf679eebb98)

**3.-**   If you are using a **Custom Input System**  you will need to connect:

* `bool RiderCombat.Aim()` to your **Aim** Input.
* `RiderCombat.MainAttack()` && `RiderCombat.MainAttackReleased()` to your **MainAttack** Input.
* `RiderCombat.SecondAttack()` && `RiderCombat.SecondAttackReleased()` to your **SecondaryAttack** Input.

&#x20;If you want to continue using [**Malbers Input** ](https://malbersanimations.gitbook.io/animal-controller/main-components/malbers-input)then use the Context Menu "Create Combat Inputs".&#x20;

![](https://lh4.googleusercontent.com/9Rea0jj6KbdlX2Y96XTHUangwC_HHetJP--n00W_ZsFlwfDdmxyCSGGbqoJNmHY4y5KlmRimAijJcNBWxx1lfrhS5ydECud8Qcig-LRtb_lNi6EoanpOh1nyeSAC1YBW6TIHGD0o)

This automatically add to the [**MInput** ](https://malbersanimations.gitbook.io/animal-controller/main-components/malbers-input)Script the Inputs needed for the Rider Combat and connect the inputs events to the proper methods.&#x20;

You can change the *Type* from **Key** to **Input** and add those Inputs to the [**Unity Input Manager.**](https://docs.unity3d.com/Manual/class-InputManager.html)<br>

**3.-**   Create the Combat  Event Listeners by using the Context menu "*Create Event Listeners*".

This will automatically add the[ MEventListener](https://malbersanimations.gitbook.io/animal-controller/scriptable-architecture/scriptables/mevent-listener) component with the Events needed for the Rider Combat system  to communicate/listen to external scripts in a non-dependant way.

![](https://lh3.googleusercontent.com/lCrHSgo4Y9yNijXPcnvVP6kffjbamrByb0R_ot1wLAgFpPVzBAGl0nfrOkhRVfZUcttaaGDz5MeI5am7zIH-8IkrMxy_kxtgSR3MbRhociNilRaBuYdpYncOQ2KwbbtW0OjkWS52)

![](https://lh6.googleusercontent.com/Ju-j55VZnPF_SVQWhICdCLaoX0LD6phyQ6TZFnDgJ6l7z1bEQT0CzJ9_p0bB6dPdfJzLO5NHi_E7R6QWI2oWgZRvcGFkaG_8NCJWWs_6K05vdj56GDhNTfHTtsdombpsMaamnrNo)

**4.-**  Disable **Exit on Dismount.** (This Option makes the rider to store the weapons if he dismount the animal)

![](https://lh4.googleusercontent.com/eQIJ2DP_yfr8LklqgUF3v1TO9O7E8jXjxggMW0hZNaDwiiOEx6uQZ-RhGaynI8C9dwVEaclk5cNzbrKKieDYNpdvvIKvoaIAgKx_yNSNIYaVD624W_7GzSYriHdSQbMR1KMn8W5I)

**5.-**  On the **Abilities** group, add a new Ability and use **Rider Melee Combat**

![](https://lh3.googleusercontent.com/yhG6ji5oliTMQqBC_aftOHEPyGjYSgsr7CxsF-0Uoyt6Pq6IN-SX1bcRGrTPtihSPgBRIxNQIymy6GW7d_S9-ubDLFpGdtimx1UauOOsNBFvbFBbPhvopNNlk7PrAYgjAWEINl9m)

{% hint style="info" %}
This allows the Rider to use the melee Animations for the melee weapons while is riding
{% endhint %}

**6.-**   For the controller with the Inventory… make sure you have activated **Inventory**  and **Already Instantiated** on the Holder/Inv Section.

![](https://lh4.googleusercontent.com/MKN58gtBPf5p_lRT9xapJyvO3qqwvwcQrj_8zfc9y-JOTBgOjkKHfM6ShvPKtaqxLYnldlpEHWJTjrFcg78iuAuxyKbtSdr9RPbj6wDcWm66p1ed1A6lf5hwy4nmrS7_KF16TGXu)

Now the Controller should be able to use melee weapons while riding the horse.  :grin:&#x20;

## Archery Pack

(...)

## Camera Controller

**1.-**  Go to the Integration folder and download the Camera Controller UnityPackage..

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0_L3AVgjmdaD7IoFkw%2F-M0_L5mVwyIDhPYlj-7b%2Fimage.png?alt=media\&token=92ee56ac-2973-4c71-95b4-d2e343e86099)

**2.-**  Import it to your project&#x20;

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0_L3AVgjmdaD7IoFkw%2F-M0_LI2RzwYvxTEs1T7T%2Fimage.png?alt=media\&token=e2f3a68f-073e-4e76-b3c6-5e9775e259fb)

{% hint style="info" %}
This **prefab** has all the necessary Camera States in order to work with HAP, but you can add your own if needed&#x20;
{% endhint %}

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0_L3AVgjmdaD7IoFkw%2F-M0_LvgWdIyxi6GjN3uY%2Fimage.png?alt=media\&token=aed7ae6c-28a7-4e27-bac8-f78b75c086d1)

**3.-**  Drag the Prefab the Camera controller prefab to your scene and remove the Old Camera Rig

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0_L3AVgjmdaD7IoFkw%2F-M0_Ldgf2e914qlZeXHR%2FOcx55Ip4ZB.gif?alt=media\&token=fae52332-dbf9-442a-b7b1-4747979afaf7)

**4.-**  Replace on the Link Script  the camera rig with the Camera Controller Rig

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M0_L3AVgjmdaD7IoFkw%2F-M0_MQ5XI6qVgAqjyy4R%2Fimage.png?alt=media\&token=f7450a59-1740-40c8-a90e-fa5dce30abf2)

And that should be it. :)
