简体   繁体   中英

Unity: skinned mesh vertexbuffer output slightly different than correct results

It's like this hip is stuck in place, with in the pictures(being at different times in the animation since I can't upload a gif) the red wireframe is the drawing of the raw output triangles and everything else being default unity, aka the correct output What am I doing wrong? What am I missing? This has been driving me nuts for 2-3 days now, any help is appreciated

红色是顶点缓冲区的原始输出,其他一切都是默认统一的

动画的不同帧显示偏移或差异不是恒定的

As you do not post any code, I will try to do some guessing over what is going on. Disclamair: I actually happen to run into similar problem myself.

First, you must know that Update's of MonoBehaviour are called in random order (not neccessery random-random, but yous see the point). If you bake mesh in one component, it can still be one-frame late to the Animator component.

There are actually two solution of this case: first is to specify the order of Script Execution Order in Project Settings, while the second is to use LateUpdate instead of Update when updating mesh after skinning.

The second problem you might have run into is scale / position of skinned mesh. Even if it does not contribute at all to the animation movement it can still wreck the mesh baking collision later on.

To fix that make sure that all your SkinnedMeshRenderers objects have Local Position, Local Rotation and Local Scale set in Transform component to identity (0,0,0 for position and rotation, 1,1,1 for scale). If not - reset those values in editor. It will not change animations, but it will change mesh generator.

If both solutions does not work, please describe the problem more thoroughly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM