- Home /
Animating an Animation Parameter with Mecanim
I have a scene with a root that has an Animator (with an AnimationController that plays an AnimationClip 'DoCutscene'). I have a minion in the scene, and its AnimationController has an Animation Parameter 'BobbleIntensity' of type float. I want to animate 'BobbleIntensity' through a curve in the 'DoCutscene' AnimationClip. I go ahead and do it ('BobbleIntensity' shows up as an animatable property in the Animation editor). But then when I run it, the parameter is never actually set (I printed it out every frame to make sure).
Is there something else you need to do to animate an animation parameter? I'm assuming that there is some way to make it work, otherwise why would animation parameters be exposed as animatable properties? Something odd I found was when I edit the curve for the animatable parameter, if I enter a value manually at a keyframe and press enter, the value resets, but if I dont press enter (or just move the keyframe), it doesnt reset that keyframe value.
Right now my workaround is to make a script with a proxy public float, animate that, and then assign the 'BobbleIntensity' animation parameter manually from that proxy. My main goal is just to be able to control which animations play and when for various objects during an overarching scene animation (the cutscene).