• Editado

我在项目中的飘带使用了物理来做,但在Preview view中查看时,不同动画切换会受物理影响有个很大的晃动。我要如何在切换动画进行动画Mix时消除物理骨带来的晃动影响?

Related Discussions
...

Hello, I will answer from an editor point of view, maybe my colleagues have code suggestions.

The fact that physics are pretty much doing everything on their own automatically is usually pretty awesome but indeed it can get in our way when the movement or pose change from one animation to another is too sudden or too great in difference.
The closer a pose is to another, the smoother the transition will be. While if the distance is greater, a longer mix from one animation to the next may help.
If you need to suddently transition from a pose to another and see it nicely in the editor, I think there are 3 possible ways to have it be less jumpy:

  1. Bring the initial/ending poses of your animation to be closer or more similar to minimize jumps.
  2. Increase the mix and do so also at runtime so that the phisics have more time to catch up and follow along.
  3. Create brand new transition animations where you copy the last pose from one animation and the first pose of the next, so that you can control better the transition, maybe keying some physics properties to have them just right for your use case.

    Erika 你的建议很不错!这确实能减缓物理的影响,但我想要完全消除这种影响,比如我希望Mix为0的情况下保持生硬切换的效果,但即便这样物理依然会起作用,这不符合我的预期。我就是完全不希望在切换动画时不管是否Mix,都没有任何物理存在,如果没有方案能解决的话我只能考虑放弃物理骨来编辑了。

    Are you going to use this in the editor only, since you mentioned the Preview view, or do you intend to use this as runtime, and if yes, what runtime?

      Erika unity runtime,我可以做什么?

        林汤圆 You can reset Physics Constraints by calling Skeleton.UpdateWorldTransform(Physics.Reset);. This will reset the physics to the current pose, which should not be affected by the pose of the previous animation. If this is not what you are looking for, I would appreciate it if you could provide examples of what specific state you are looking for.