What's the distinguish between SetBool and SetFloat??

what’s their function

The documentation is pretty explicit:

  • SetBool sets the value of a Boolean parameter on an Animator.
  • SetFloat sets the value of a float parameter on an Animator.

SetBool is preferred when you have to transit between animations based on true/false conditions.

For example: If player is not on ground change animation from run to fly and vice versa.

SetFloat is preferred when you have to transit between animations based on numerical value.

For example: When movement speed is less than 0.1 change animation from walk to idle. When its greater than 0.1 change animation from idle to walk. And if its greater than 1, Change animation from walk to run and so on.