- Home /
How do I prevent animation lag on bones?
I'm not entirely sure but I think this started in Unity 3.5. The orientation of my bones seems to lag behind the mesh animation. What this means for me is that attached objects on my characters will bob around as if they are being dragged behind the animation.
Normally this wrist attachment would be joined to the player's wrist, but it's offset quite a bit since the arms move about quite a bit while running. This behavior is consistent with other attachments such as the glasses (which clip a little in this screenshot), and the hair.
I've tried forcing the attachments to have a zeroed out transform on every LateUpdate thinking that something funky was going on but no joy. I've watched the bones and they don't seem to be doing anything strange with their transforms and the attachments transforms are always at zero local position/rotation.
Also, I tried to send a bug to Unity but the bug reporter threw an error.
Thoughts?
Answer by LoganBarnettASU · Apr 11, 2012 at 06:29 PM
It turns out the problem was with using BasedOnClipBounds for my culling type. Switching from this:
animation.cullingType = AnimationCullingType.BasedOnClipBounds
To this:
animation.cullingType = AnimationCullingType.AlwaysAnimate
Fixes the problem. For more info, it turns out that the bones weren't lagging behind, but the mesh itself was instead. In the screenshot above, the character's arm is moving downward. The wrist attachment is ahead of this animation whereas the mesh is behind. I hope this helps anyone else who runs into this issue.
Your answer
Follow this Question
Related Questions
Character Animation Lags in Multiplayer 2 Answers
Is it possible to edit an armature once it is imported into Unity? 1 Answer
Multiple Animated Objects Causing Lag! 0 Answers
Can I restore bone locations in skeletal animation after the character was deleted? 0 Answers
Mesh doesn't follow bones 0 Answers