- Home /
Animator parameters (float) not changing
I made a float parameter in the animator, then assigned it as a state's multiplier (click on the state, and tick multiplier and assign the parameter).
But when I try to change the value from script, it doesn't change, even when the Animator.SetFloat is in the Update function. No typos, all seems good.
private Animator anim;
public float beatFrequency = 5f;
void Start()
{
anim = GetComponent<Animator>();
anim.SetFloat("frequencyMultiplier", beatFrequency);
}
private void Update()
{
anim.SetFloat("frequencyMultiplier", beatFrequency);
}
What could be causing this? Thanks!
Does anything happen in your console? Pull Animator window to the side so you can watch it during play me, see if the float changes. If not, perhaps something else is also setting it?
Float does not change. Animator window open, and object selected
Answer by joebopie · Sep 13, 2021 at 10:09 PM
The 2 values after anim.SetFloat("frequencyMultiplier", beatFrequency); also need to be set e.g anim.SetFloat("frequencyMultiplier", beatFrequency,0.1f,0.1f);