Unity Input System (NEW)

Integration Package: Integration Drive Folder

Latest Version: 2.0.2

  • Added: Ignore Horizontal, Vertical, UpDown Axis

  • Improved: Reading the axis from Move Context.

  • Added: OnInput Enabled and Disabled send the Player Index

  • Minor Editor fixes

pageNew Input Link [Old Versions]

Input Action Types for Animal Controller

These are the types of input values that the controller will recognize.

Axis values

Use this Input type for Axis movement (Player Movement and Camera Movement)

If you are going to use Axis type in other logic besides Player Movement or Camera Locomotion

Use the Vector2 value on the interaction type:

Buttons

Use this Input type for all button interactions (Jumps, Actions, Sprint, etc)

Triggers

Triggers on your Gamepad need to be set as Value.

The Interaction type for Triggers needs to be set to Float

Integration Steps

1. Install the new Input System from the Package Manager Window

Go to Window -> Package Manager

Install the latest version of the Input System package.

Unity will ask you to restart the Editor to install correctly the Input System.

2. Import the integration Package from the Integration Drive Folder

Download and Install the Integration package on your project.

3. Select any Prefab/animal the Malbers Input/MInput component.

Those Malbers Input/MInput Components, need to be replaced with the new MInput Link. But first, we need to check all the connections the old inputs can have.

The Animal Controller makes automatic connections with States and Modes using the Name of the Input.

For example for the State Jump the Input Name is "Jump"

Add the component to the same gameobject the Animal Controller is.

5. Add a Player Input.

Add Unity Player Input Component and set it as reference for the Input Link

6. Add an Action Input Map

By default for Malbers Animals and creatures you can use the <Malbers Input> Action asset, but you can use your own Input Action Asset.

Add your Input Map to the Player Input Component

7. Select the Active Action Map to Find the Buttons

Add your Default Action Map so you can connect those inputs to the Animal Controller

After selecting the Active Action Map Click Find Buttons.

All the parameters will be filled automatically. with all the Inputs that are set as <Button> Type.

Move and UpDown Inputs will be set on their respective parameters.

You can add other inputs manually by simply creating a new element:

8. Connect the Inputs to the Animal Controller

By default, all the Inputs with a Name that matches the States and Modes are connected automatically with the Animal Controller.

For example: the Jump State has an Input<string> value to find its Input so it will be connected automatically with the Jump Input:

Just like States, Modes has their Input<string> Value to connect automatically to the input source:

But other features like Sprint, Speed Up, Speed Down, they need to be connected manually.

As stated in Step 3. Do not remove yet just yet the MalbersInput/MInput component.

Check the connections all the Inputs have and do them on the New MInputLink component.

E.g. Sprint is connected on the Input Changed Event with Animal.Sprint Interaction [Press]

E.g. SpeedUp is connected on the Input Down Event with Animal.SpeedUpInteraction [Down]

E.g.: In case of the Rider in HAP the Default Action Map should be Gameplay:

E.g.: In case of the Horse in HAP the Default Action Map should be "Riding". So the horse will be only moving when that Action map is activated by the rider when he finish mounting

IMPORTANT: After all connections are made you will need to remove the Old MalbersInput/MInput component.

Camera

Instead of using the Default Virtual cameras

Use instead the new Prefab located here:

This prefab has already all the connections done for the new Input system. The MInput Look Component is using the correct Input Action References for moving the camera

Overview

This component will Invoke a String Event with the Display value of an Input Action, when the Control Scheme changes.

That Sprint Value can be connected to any UI Text to display the right UI Value for the Input.

Do that for all the UI Buttons.

Rider

For Horse Animset Pro the Rider and the Horse have Different Action maps

Use instead Malbers Input HAP. You can always modify it to your needs.

In the case of the Rider, you will need to change the Active Action Maps while Riding.

When the Rider Finish Mounting the Action Map is changed to "Riding" will be changed to Riding (Using the event MRider.OnMountEnd()

When the Rider Finish Dismounting the Action Map is changed back to "Gameplay" will be changed to Riding (Using the event MRider.OnDismountEnd()

Gameplay Connections

Always check the old Malbers Input connections to apply it to the new MInput Link inputs

Here are the Malbers Input HAP "Gameplay" Input Action connections. Remember to check the Interaction on each Input Action.

Move

Leave the Connection to Gameplay/Move Input Action

Jump

Is Connected automatically with the Animal Controller with the Jump State.

Sprint

Interact

Mount

Riding Connections

Here are the Malbers Input HAP, "Riding" Map, Input Action connections. Remember to check the Interaction on each Input Action. This will be the Inputs

Move and UpDown

Clear the Connections with Move and UpDown since they will be used on the Animal Mount Instead.

Aim

Attack1

Dismount

Inventory 1

Inventory 2

Inventory 3

Inventory 4

Reload

Horse

In case of the Horse instead of using the "Gameplay" Action Map as the Default and connection, will be using the "Riding" Action Map. That way all Horse Movement will be active only when the Rider finish mounting.

You can use all of the inputs or some of them. Is up to you. :)

Jump

Jump is connected Automatically with the Animal Controller

Sprint

Attack1

Attack1 is connected automatically with the Attack1 Mode. Is recommended to be disabled if the rider is using weapons

Interact

No connection here.. you can add the Action Mode Input name here if you like

Strafe

Speed Up

Speed Down

Last updated