- Home /
The question is answered, right answer was accepted
Armature bone unable to rotate while animation playing
I'm trying to have my non-humanoid character look at the player as the character is in a walking animation however my head doesn't want to rotate only when I'm playing my walking animation. I've created an avatar mask with the head bone unchecked and applied it to my animator base layer, however, the head still barely moves as compared to when there is no animation. I tried breaking the armature where the neck meets the head and it works exactly as I want it to. The only issue is some animations do need to animate the head. So i'd probably have to sync two animators or something which seems silly. So any thoughts on why my animator seems to affect my head regardless of the bone being unchecked? I even tried unchecking all bones and no luck. By the way, I'm modifying transform.rotation of the head bone to make it rotate.
Answer by sgthale · Jun 20, 2018 at 11:05 PM
Just set the head rotations in the LateUpdate() not in the Update().
I had the same thought and it's already set that way. It seems if there is any sort of animation playing the animation will interfere with the rotation.
Wow, I just realized it was because of Slerp. I was using Slerp with the current rotation value. So the animation was applied then my Slerp would use the rotation of the animation. That's why it seemed to work a little. I've stored the rotation in a new variable so that the animation can't touch it. Ahh that's frustrating, thanks for the answer though.
Follow this Question
Related Questions
Why when creating new animator controller for the character the character is not walking right ? 0 Answers
How can i check if animation has finished playing if the object have no animator attached ? 1 Answer
Help with animator controllers 1 Answer
why I have to anim.getComponent in update() function when I had done in Start () function 2 Answers
Animator not working properly 1 Answer