|
I've made an animation where a charakter walks and holds a weapon with his hand. Then I wanted to move the hand up and down with a script so the arm angle is always the angle, where the camera looks. Unfortuntely, it didn't work well. Unity can't decide what it should make, fbx or script? So the arm jumpes around. How can I solve it?
var Arm : Transform; function Update () { transform.rotation=Quellobjekt.transform.rotation; Arm.Rotate(50,0,0); }
(comments are locked)
|
|
Set the rotation in LateUpdate instead of Update, as animations are done between the two functions
(comments are locked)
|
|
Just a brief addition: Keep in mind that even with the LateUpdate() solution described, there can be another problem arising when propagating the bone rotation over RPC in a network game. In such cases the result will be a weird "bone flapping" due to network lag. But this can easily be worked around with the solution described here: http://answers.unity3d.com/questions/126368/how-to-rotate-a-bone-during-an-animation.html (follow the comments by Owen Reynolds)
(comments are locked)
|
