- Home /
Rotate bones during mecanim animation with generic avatar
Is there a way to specifically control the rotation of a bone via code while using a Generic avatar within mecanim? This was easy with the old animation system, where you would just rotate the bone within LateUpdate. Currently, attempting the same thing results in mecanim always overwriting the adjusted bone rotation regardless of where in the pipeline you rotate ( Update, LateUpdate, FixedUpdate).
I also tried to put in all of my animations with a Skeleton Mask that specifically left out the bone I wanted to rotate. This didn't seem to make any difference.
Just suggestion - animator component overrides your bone rotation with some active animation clip. Try to disable all animation clips for the bone by using animation layers with active bone filter.
Thanks for the suggestion.
Unfortunately, that is what I meant when I said that I put all of my animations within a skeleton mask. Just to test it even further, I remove all animations from the animation controller and added a single animation to a second layer with a Skeleton $$anonymous$$ask that had only a single, obscure bone selected (the finger). Yet somehow, even this overrides my bone rotation. Calling Animator.IsControlled on the bone always returns True as well.
Hi coma_bc,
don't know whether your issue reported is still present. But I am curious, because I am struggling with similar problems, as posted here: http://answers.unity3d.com/questions/402259/how-to-combine-mecanim-and-script-based-bone-movem.html.
You state above that the LateUpdate() solution should have only worked in the "old animation system". I suppose that by "old" you are referring to the "regular" animation system (i.e. not mecanim)? However, I am using a generic model like you (animated in blender and imported as "generic"), and in my case the LateUpdate() works like charm: I can easily apply additional (player/mouse controlled) bone rotation to specific bones, thus overriding any rotation applied by the animation. So I guess that there's something else going wrong in your case.
Just to be sure: Are you trying this in single-player mode, or in a multiplayer game, where you propagate the bone rotation changes over RPC? Because the latter is what causes the problems for me (as described in my linked post).
Answer by coffiarts · Mar 07, 2013 at 10:33 AM
You might want to check whether this thread gives an answer to the question reported here: How to combine mecanim and script based bone movement/animations?
Your answer
Follow this Question
Related Questions
Weird issue with Blender animation running riot in Unity 2 Answers
Issue with rotation of an animation 1 Answer
How to combine mecanim and script based bone movement/animations? 2 Answers
Mecanim questions 0 Answers
Configuring Avatar 1 Answer