- Home /
LateUpdate override of bones in Mecanim Animation not working
Unity 4.6 b17
I have a mecanim animation (Generic) playing on the model. I have a script placed on the neck bone as I wish, occasionally to take over control of the head. In the LateUpdate() of the script I set as a test
transform.eulerAngles = new Vector3(00,180,0);
what i would expect in this case is the head angle to be rock steady in world-space, however the rest of the animated parts moved... what actually happens is that the code affects the head but it still wobbles about and rotates slightly here and there - affected by the animation. When the animation is turned off it behaves perfectly. ... all the answers I've searched seem to suggest that LateUpdate is the answer but it's just not working for me... Anybody got a clue for me? Animate Physics is not turned on... thanks a bunch.
Were you ever able to solve this? I'm running into the same issue right now.
I'm experiencing the exact same issue... trying to make a custom I$$anonymous$$ for a non-humanoid rig, and trying to have it such that the character is sometimes controlled entirely by $$anonymous$$ecanim animation, and during a few states, would like to override the control of the arms myself in LateUpdate(). What I end up with is a sort of both things happening, where the arms sit in a position affected by the animation (even if I mask those limbs) and also do the I$$anonymous$$ tracking of the target, so it's kind of a halfway thing :/
Answer by Quaker_SDR · Sep 30, 2014 at 11:51 AM
You can try avatar mask, it will allow you to do the same you expecting for. Avatar Mask
hi thanks for your reply - this also does not seem to work... i create a mask which has all the bones in it apart from the eyes. Then when i play the animation it's correct - the anim plays but the eyes are dead. As soon as I try to use LateUpdate to set the transform of the eyes - they once again act as if they are affected by the animation! I am somehow reactivating the animation by trying to set the transform...
Answer by Gazowen · Jun 17, 2015 at 10:31 PM
Does your script use a smooth factor for the animation? This was an issue for me.. The mask also did nothing for me, it seems the mask, does not truely mask the bones, but instead the animation is applied to all bones and then masked.. If that makes sense? I'm away for a week, but if you can't solve it by then I will take a look at my code when I am home and see how exactly it was solved.