Invector Templates
Last Update: HAP 4.2.6d Invector 2.6b
Asset Location
Install the Integration Package
1.- Download from the Integration Drive Folder the package of the Template you own (Basic, Melee, or Shooter).
2.- Install/Drop the unitypackage to your project.
You can test the Integrations Demo Scenes on each Template Folder:
Malbers Animations/Horse AnimSet Pro/Integrations/Invector
IMPORTANT: As part of the integration package all Invectors weapons prefabs that can be used with HAP, are modified and they have a MWeapon component; so they can be recognized by the Riding Combat System.
General Integration Steps
If you want to check how the final integration with the Basic Template: open the Demo Scene: v3rdPersonController - HAP on the HAP Integration Folder.
To create a new integration from scratch you need to do the following steps...
These steps are also included in the Melee Template and the Shooter Template, but with small changes.
1.- Open the Demo Scene on the Invector Demo folders:
🚶 v3rdPersonConroller_Demo
⚔️ vMeleeCombat_DemoScene
🔫 vShooterMelee_DemoScene
2.- Drag to the scene the Horse Realistic Prefab.
3.- Select the Character Controller Prefab:
🚶 vBasicController
⚔️ vMeleeController_Inventory
🔫 vShooterMeleeController
4.- Change the Animator Controller:
🚶 from Invector@BasicLocomotion to Invector@BasicLocomotion_HAP
⚔️ from Invector@MeleeCombat_Upperbody to Invector@MeleeCombat_HAP
🔫 from Invector@ShooterMelee to Invector@ShooterMelee_HAP
This Animator already has the Mount Layer and the Rider Animator Parameters added. If you want to know how to add the Mount Layer to any Animator you can find out HERE.
Make sure your Character Controller has the Animator set to Animate physics
Mounted and Combat Layer
If by any chance you have modified your Animator Controller, or you are using other Animator Controllers Provided by Invector. you can always add the Mount Layer and Rider Combat Layers provided for the Riding system.
Rider Component
5.- Add the MRider script to your Character controller.
6.- If you are using a "Custom Input System" you'll need to connect MRider.MountAnimal() to your Mount Input, and MRider.DismountAnimal() to your Dismount Input. If you want to continue using my Malbers Input then use the Context Menu Create Mount Inputs.
This will create a MInput component with 3 Inputs for the Rider (Mount, Dismount and Call Mount); and connect the events of the inputs to the proper methods.
You can change the Type from Key to Input and add those Inputs to the Unity Input Manager.
7.- On Disable Components 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).
In the case of Invector, it should be the VFootStep, VRagdoll, VGenericAction, VLadder, or any other you feel is necessary. Components that may interfere with the Riding system
UI
8.- Add the Mount UI prefab to your current UI Canvas.
The Mount UI notifies you when you can press the Mount and Dismount Inputs
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.
Link Script
The Link script is the bridge between the Rider Component and Invector's templates. Allows the Rider to communicate with Invector's 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
11.- Add the Invector HAP Link script to the Character.
🚶 With "Basic" Template add Invector HAP Link script
⚔️ With "Melee" Template add Invector HAP Melee Link script
🔫 With "Shooter" Template add Invector HAP Shooter Link script.
Camera Settings
12.- Select the ThirdPersonCamera gameObject and change the Camera State List from:
🚶 vBasicLocomotiont@CameraState to vBasicLocomotiont@CameraState_HAP
⚔️ vMeleeCombat@CameraState to vMeleeCombat@CameraState_HAP
🔫 vShooterMelee@CameraState to vShooterMelee@CameraState_HAP
This new state list contains the Camera State Ride used when the character is riding the horse.
13.- Add the MEventListener component to the ThirdPersonCamera.
14.- Create a new Event Listener and select the Event Set Camera Settings
15.- Enable the Transform (T) Listener and disable the Void Listener. Create a new Unity Event Listener and drag the same game object to the Runtime Only Slot.
16.- Add the *dynamic method vThirdPersonCamera.Target()
to the Listener.
And that should be it… the basic controller should be able to ride the Horse.
Melee Template
For integrating the Melee Template you should follow the same steps of the Basic Template but follow the Melee Template Steps.
if you want to check how the final integration should look like you can open the Demo Scene: vMeleeCombat HAP4.
The Extra Steps you should follow to complete the Melee Integration are the following:
Weapon Manager Component
Add the Weapon Manager Script.
But, if you want to learn how to add the Combat Layers check this video:
Inputs
If you are using a Custom Input System you will need to connect:
MWeaponManager.Set_Aim(bool)
to your Aim Input.MWeaponManager.MainAttack(bool)
to your MainAttack Input.MWeaponManager.SecondAttack(bool)
to your SecondaryAttack Input.MWeaponManager.ReloadWeapon()
to your Reload Input.
But If you want to continue using Malbers Input then use the Context Menu "Create Combat Inputs".
This automatically adds to the MInput Script, the Inputs needed for the Rider Combat and connects the inputs to the Weapon Manager methods.
You can change the Type from Key to Input and add those Inputs to the Unity Input Manager.
Events
Create the Combat Event Listeners by using the Context menu "Create Event Listeners".
This will automatically add the MEventListener component with the Events needed for the Rider Combat system to communicate/listen to external scripts in a non-dependant way.
This is used for Mobile Input on all HAP Demo Scenes. Skip this part if you are not using Mobile
No Equip Points
In the General group -> Weapons Equip Points; Remove the [Left Hand] and [Right Hand] References and set to true the [Ignore Hand Offset] Parameter.
Invector System will be handling all the offsets and weapon parenting to the proper position.
Use External
Select the Holsters/Use External and set [Use External]
[Instantiate On Equip] = false and [Destroy On Unequip] = false
Invector System will be handling all the weapon instances.
Shooter Template
For integrating the Shooter Template you should follow the same steps as the General Steps but follow the Shooter Template way.
Also, you need to follow the Melee Template Steps.
If you want to check how the final integration should look like you can open the Demo Scene: vShooterMelee Inventory HAP.
Make sure the Invector's Bow and Handgun have the Malbers Weapon component attached to it.
Now the Controller should be able to use the pistol and the Bow weapons while riding the horse.
Next:
On the next page, check how the weapons are properly configured to be used with HAP
Invector Weapon Settings
Last updated