Malbers Input & MInput

Overview

This is the Input Source for all the animals and creatures. This will send the Inputs values to the Animal. When using the Animals for AI you donโ€™t need to add this script since the AI will handle the Movement and other Logic.

The Different between Malbers Input and MInput is that the last one does not have any Axis (Horizontal, Vertical and UpDown). MInput is used only when the Movement Axis are handled by an external component.

When Using the Riding System this component must be Disabled. Otherwise the animal will move as soon as you press any of the Inputs and we donโ€™t want to start moving when the rider is NOT mounted.

Parameters:

Horizontal/Vertical Axis/UpDownAxis:

These are Inputs from the Unity Input System (Horizontal and Vertical are created by default). Custom Advanced Third Person Controller(TPC) Uses their own Input values. You can easily change it here to match the inputs from those TPC.

Inputs Field

This are the Inputs used to activate any logic you need from any Component. They use the iMalbersInputs interface to communicate with the Animal Script. If you are using a custom input system just change the type to Input and use the same Input Value on the Unity Input System.

Input Field (InputRow) Parameters:

Active

Is the little checkbox near the name. It will enable and disable the input.

Name

Name of the Input. It is used on the States, and Modes to Identify who's the input that will activate their logic.

Type

Type of the Field... which you can choose between "Key" or "Unity Input".

Value

Value of the Input. If the Type is Key you can pick a Key Code. If the type is Input

Button

Logic of the Input you want to use

Select an Input Field and you will access their Events and Properties

Press

The Input will Register 2 Events: On Input Pressed() and On Input Changed(boolean).

  • On Input Pressed: Is invoked every time the Key/Input is Pressed

  • On Input Changed: Invoke true when the Key/Input is Down and false when the Key/Input is released

Down

The Input will Register 2 Events: On Input Down() and On Input Changed(boolean).

  • On Input Down: Is invoked when the Key/Input is Down

  • On Input Changed: Invoke true when the Key/Input is Down and false when the Key/Input is released.

Up

The Input will Register 2 Events: On Input Up() and On Input Changed(boolean).

  • On Input Up: Is invoked when the Key/Input is Released

  • On Input Changed: Invoke true when the Key/Input is Down and false when the Key/Input is released.

Long Press

  • Long Press Time: Time required to do the long Input/Key press.

The Input will Register 4 Events:

  • On Long Press: Is invoked the Long Press time ends.

  • On Pressed Time Normalized: Invoke a normalized value from 0 to 1 every frame the Key/Input is pressed during the Long Press Time.

  • On Pressed Down: Is invoked when the Key/Input is Down the first time.

  • On Pressed Interrupted: Is invoked when the Key/Input is released before the Long Press time ends

Double Tap

  • Double Tap time: Valid Time between the first input and the second input to be consider a Double Tap.

The Input will Register 2 Events: On First Tap() and On Double Tap().

  • On First Tap: Is invoked on the First Input/Key Down.

  • On Second Tap: Is invoked if the First Input/Key Down is pressed again withing the Double Tap Time value.

Events

On Input Enabled

Invoked when the component is Enabled.

On Input Disabled

Invoked when the component is Disabled.