Animator parameter does not pick the value of the animation curve with the same name

Hi, everyone, I am trying to detect a certain point/range in my animation clip from script and I read that the thing to do is to add to the Animator Controller that has the animation a float parameter with the exact name as the animation curve. However, this simply does not work for my project. Any ideas?

Thanks in advance!

No, that won’t work. AnimatorController variables get their values from code. and use them for animation decisions, not the other way around.

There are two ways you can do this. You can do it entirely in code, looking at the time values in the Animator’s current active clip, or use animation events.

A bit late to this party but I just wanted to leave this up-to-date answer in case it helps anyone else.

As stated by the Unity docs you can have an animator parameter automatically pick up values from an animation curve as long as the animation is being used by the animator controller state. Otherwise the parameter will just have the default set value or any value set by your scripts.

Some extra details are provided at the bottom of this page: