Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Animator Parameters | Unity Animation System
Fighting Game in Unity
course content

Conteúdo do Curso

Fighting Game in Unity

Fighting Game in Unity

1. Unity Animation System
2. Player Behavior
3. Enemy Behavior
4. Improve the Game
5. Improve the Flappy Bird Game

bookAnimator Parameters

Bool Parameter

Use: Bool parameters are commonly used to represent binary conditions, such as whether a character is walking or not, or whether a door is open or closed.

Example: You might use a bool parameter named "IsWalking" to control the transition between idle and walk animations for a character. When the character starts walking, you set "IsWalking" to true, and when they stop, you set it to false.

Behavior: When a bool parameter is set to true, it remains true until explicitly set to false.

Trigger Parameter

Use: Triggers are useful for one-time events, such as triggering an attack animation or opening a door.

Example: You might use a trigger parameter named "Attack" to play the attack animation of a character. When the player presses the attack button, you set the "Attack" trigger to true, causing the animator to transition to the attack animation. Once the animation is complete, the trigger automatically resets to false.

Behavior: When a trigger parameter is set to true, it immediately returns to false after the current frame has finished executing.

Float Parameter

Use: Float parameters are commonly used for controlling transitions that involve gradual changes, such as blending between animations or adjusting the speed of an animation.

Example: You might use a float parameter named "Speed" to control the speed of a character's walk cycle. As the character's movement speed increases or decreases, you update the "Speed" parameter accordingly, causing the animator to smoothly transition between different walk animations.

Int Parameter

Use: Int parameters are useful for representing discrete states or categories, such as different levels of health or different attack modes.

Example: You might use an int parameter named "Health" to represent the current health level of a character. As the character takes damage or receives healing, you update the "Health" parameter, which could trigger transitions to different animation states (e.g., injured animations when health is low).

What’s Next

Next, we will see how to control the animations with scripts and how to manage transitions between animations using scripts.

Which types of parameters can be used in the Animator?

Which types of parameters can be used in the Animator?

Selecione a resposta correta

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 4
some-alt