- Home /
Question by
SalvoSoftware · May 26, 2013 at 03:01 PM ·
mecanimanimationsbonesbone
How can I change bone's rotation by script during an animation?
I'm using Mecanim Animator, and I wrote this code:
function lateUpdate(){
if (aiming){
var cameraTransform = Camera.main.transform;
leftArm.rotation = cameraTransform.rotation;
rightArm.rotation = cameraTransform.rotation;
}
}
But the arms keep following the animation, I tryed to change .rotation with .localRotation.eulerAngles using a vector3 but nothing changes, how can I fix it?
Comment
Sorry, I just wrote lateUpdate and not LateUpdate xD
You can edit your question. Also entries in the Answer sections are reserved for attempts to answer your question. Comments can be added by clicking on the "comment" button.