Course Content
Fighting Game in Unity
Fighting Game in Unity
Animator 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.
Thanks for your feedback!