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!