How can I change all boolean parameters of an animator to false
?
Here is a solution which I found:
foreach (AnimatorControllerParameter parameter in playerAnimator.parameters)
{
playerAnimator.SetBool(parameter.name, false);
}
The problem with this solution is that I will get a warning in console if my parameter in Animator
is not a boolean. I would not like to be getting that. So, I need somehow to being able to take only parameters of type boolean.