Hello human beings!
I want to set all the bool parameters in the animator of an object to false, to then be able to set only the one i want to true without needing to set each parameter prematurely in the editor.
I have tried doing that in many different ways but i can’t figure out how!
I don’t think my code will be any use but:
public Animator timeReflectionAnimator;
public AnimatorControllerParameter[] parameters;
private int posInList = 0;
foreach (AnimatorControllerParameter parameter in parameters) {
if (parameter.type == AnimatorControllerParameterType.Bool) {
timeReflectionAnimator.SetBool (parameter.name, false);
}
}
timeReflectionAnimator.SetBool (animations[posInList].animation, true);
Don’t worry about the animations list. it’s a struct i made that gets a string and an int (animation, time).
Thank you for every help you can give!
Ethan