x


fbx animation beats script animation?

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 cam: Camera;

var Arm : Transform;

function Update () { transform.rotation=Quellobjekt.transform.rotation; Arm.Rotate(50,0,0); }

more ▼

asked Feb 13 '11 at 12:19 PM

Andreas Hagen gravatar image

Andreas Hagen
67 11 12 18

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Set the rotation in LateUpdate instead of Update, as animations are done between the two functions

more ▼

answered Feb 13 '11 at 02:50 PM

Mike 3 gravatar image

Mike 3
30.5k 10 65 253

(comments are locked)
10|3000 characters needed characters left

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)

more ▼

answered Feb 21 at 10:42 PM

schnaddlbraag gravatar image

schnaddlbraag
108 1 3 5

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3793
x3333
x3008
x2168
x561

asked: Feb 13 '11 at 12:19 PM

Seen: 1229 times

Last Updated: Feb 21 at 10:42 PM