- Home /
Set Unity3D AnimationClip Property Without Resetting the Animator
I'm trying to drive the animation of a Unity3D Mecanim rig based on live data from a Leap Motion Controller. I have 2 layers masking out everything but the hands in a Mecamim Human rig, on top of a base layer driving the rest of the rig. Both "hand layers" reference the same Animation Clip.
When I set the curve of a property in the clip using:
leftClip.SetCurve ("", typeof(Animator), "LeftHand.Index.1 Stretched", new AnimationCurve (new Keyframe (0, CurrentPosition), new Keyframe (0.5f, CurrentPosition)));
All currently playing states in the animator reset their playback creating a rather unhelpful jittery effect.
I'm getting a reference to the clip via the animator's runtimeAnimatorController
property so I've got a reference to the runtime instance of the clip and not the asset.
I'd like to avoid going the route of overriding Mecanim in LateUpdate()
due to the probability of race conditions with other LateUpdate-ing code and wanting to take advantage of Mecanim's animation tools in the rest of our pipeline.
Is there a method by which I can set a property in an animation clip at runtime without resetting the state playback?
Your answer
Follow this Question
Related Questions
Mecanim ik curve 0 Answers
How to stop mesh disappearing during Animator state transition blend time? 1 Answer
Mecanim transition condition can't have both bool and trigger? 0 Answers
Animation Mecanim - Parts of model displaces after animating 0 Answers
Mecanim 'Locking' my facial blendshapes 2 Answers