M.O. написалSo I am still trying to get this work , I just updated to the latest run time, and in the LateUpdate() function I am doing the following (everything else is virtually identical to the above code)
skeleton.state.Animation.Apply(skeleton.skeleton,skeleton.state.Time,true);
head.Rotation=(head.Rotation+1.0f);
skeleton.skeleton.UpdateWorldTransform();
The comment above the Apply function in the Animation script says :
/** Poses the skeleton at the specified time for this animation. */
Still there is no movement. @Nate what is the proper way to rotate the head during an animation? Thanks.
That code is ok. I assume head is a Bone. I assume you have the head keyed, so what will happen is each frame in your game, the SkeletonAnimation will update, pose the skeleton using the animation which will set the head rotation, then your code runs which adds 1 to the head rotation. So you will always get the head rotation the animation sets, plus 1. You could store a rotation value in your class and add to it each frame if you want the head to spin around. Try setting the head rotation to a fixed value, like 45.
Bone is the skeleton's current pose. You can also get the BoneData, which is the setup pose. Animations are relative to the setup pose, so you can change the BoneData with code similar to what you posted and the head will spin around. Make sense?