Override mecanim animation with manual bone rotation

Hi! I want my character’s arms to rotate according to how the right gamepad stick is pressed. This is no problem in itself, however, whenever i apply my animator controller to my character, the bones I try to rotate (in the update function) are not being affected. It is as if the script-controlled rotation is being overridden by the animation that is played. How do I make my script-controlled rotation override the mecanim animation when the player pushes the right stick?

Thanks

I’m no mecanim expert but it will probably work if you override the mecanim rotations in LateUpdate.

LateUpdate is your best friend for rotation patching. In LateUpdate, you have the Mecanim results, and you must calculate yourself how to exactly patch the provided rotations.

Yes, your 100% custom IK code should go in LateUpdate, and everything you need and OnAnimatorIK does not provide :slight_smile: