I’m using the animation controller for the first time.
I have a three step cycle that doesnt end in any dead ends. But for some reason, whenever i change a variable, the animation controller reverts to the default node, skipping the transition.
This is my relevant code
// Update the parameters only if they change
if (currentWalkingState != newWalkingState)
{
ModifyParameters(0, newWalkingState);
currentWalkingState = newWalkingState;
}
if (currentRunningState != newRunningState)
{
ModifyParameters(1, newRunningState);
currentRunningState = newRunningState;
}
public void ModifyParameters(int parameterIndex, bool state)
{
AnimatorControllerParameter parameters = controller.parameters;
parameters[parameterIndex].defaultBool = state;
controller.parameters = parameters;
}
Why does this happen, and how can i fix it??
