Next: , Up: Character   [Contents][Index]


5.1 Character Input Animator

Component: CharacterInputAnimator

Character Input Animator takes user input and applies that as Mecanim floats and triggers. This is useful for root motion characters, when you don’t want a movement script interfering with carefully-controlled animations, or for animating characters on a character customization screen. Just don’t forget to provide some input help to the user in this second case.

Field of CharacterInputAnimator: bool currentlyAnimating

Is this Character Input Animator currently controlling character animations?

Default value: true

Input Settings

Required Field of CharacterInputAnimator: string horizontalAxis

Axis in the Input manage (Edit -> Project Settings -> Input) indicating the horizonta axis, which will be sent as a float to the Animator

Default value: "Horizontal"

Required Field of CharacterInputAnimator: string animatorHorizontal

A float defined in the Animator indicating how fast we’re strafing. -1 is left, 1 is right and 0 is no strafing at all

Default value: "Strafe"

Required Field of CharacterInputAnimator: string verticalAxis

Axis in the Input manage (Edit -> Project Settings -> Input) indicating the vertical axis, which will be sent as a float to the Animator

Default value: "Vertical"

Required Field of CharacterInputAnimator: string animatorVertical

A float defined in the Animator indicating how fast we’re moving

Default value: "Run"

Field of CharacterInputAnimator: List<UserState> userStates

A list of additional states you want to bring in to the Animator, which you can trigger with messages

Default value: new List<UserState>()

Required Field of CharacterInputAnimator: float deadzone

The percentage of space in the center of the controller that is ignored

Default value: 0.2f

Available Messages

Message on CharacterInputAnimator: TriggerCharacterState (int)

Force Character Input Animator to enter one of the ’User States’

Argument: The index of the state we want to trigger

Message on CharacterInputAnimator: ReturnCharacterState (int)

Force Character Input Animator to call the ’Return Trigger’ for one of the ’User States’, sending it’s return triggers to Mecanim

Argument: The index of the state we want to trigger

Message on CharacterInputAnimator: EnableInputAnimations ()

Allows this Character Input Animator to control animations.

Message on CharacterInputAnimator: DisableInputAnimations ()

Stops this Character Input Animator from controlling animations.

Field of CharacterInputAnimator: bool currentlyAnimating

Is this Character Input Animator currently controlling character animations?

Default value: true

Input Settings

Required Field of CharacterInputAnimator: string horizontalAxis

Axis in the Input manage (Edit -> Project Settings -> Input) indicating the horizonta axis, which will be sent as a float to the Animator

Default value: "Horizontal"

Required Field of CharacterInputAnimator: string animatorHorizontal

A float defined in the Animator indicating how fast we’re strafing. -1 is left, 1 is right and 0 is no strafing at all

Default value: "Strafe"

Required Field of CharacterInputAnimator: string verticalAxis

Axis in the Input manage (Edit -> Project Settings -> Input) indicating the vertical axis, which will be sent as a float to the Animator

Default value: "Vertical"

Required Field of CharacterInputAnimator: string animatorVertical

A float defined in the Animator indicating how fast we’re moving

Default value: "Run"

Field of CharacterInputAnimator: List<UserState> userStates

A list of additional states you want to bring in to the Animator, which you can trigger with messages

Default value: new List<UserState>()

Required Field of CharacterInputAnimator: float deadzone

The percentage of space in the center of the controller that is ignored

Default value: 0.2f

Available Messages

Message on CharacterInputAnimator: TriggerCharacterState (int)

Force Character Input Animator to enter one of the ’User States’

Argument: The index of the state we want to trigger

Message on CharacterInputAnimator: ReturnCharacterState (int)

Force Character Input Animator to call the ’Return Trigger’ for one of the ’User States’, sending it’s return triggers to Mecanim

Argument: The index of the state we want to trigger

Message on CharacterInputAnimator: EnableInputAnimations ()

Allows this Character Input Animator to control animations.

Message on CharacterInputAnimator: DisableInputAnimations ()

Stops this Character Input Animator from controlling animations.


Next: , Up: Character   [Contents][Index]