Version: 2023.2
动画过渡
Playables API

Animation FAQ

General questions

Animation 窗口和 Animator 窗口之间有何差异?

The Animation Window allows you to create and edit animation clips within Unity. You can use it to animate almost every property that you can edit in the inspector, from a Game Object’s position, a material color, a light’s brightness, a sound’s volume, and even arbitrary values in your own scripts.

The Animator Window allows you to organize your existing animation clip assets into a flowchart-like system called a state machine.

Both of these windows are part of Unity’s animation system, and not the Legacy Animation system.

We use the Legacy Animation system for character animations. Should we use Unity’s animation system (Mecanim) instead?

Generally, yes you should since most character animations are more complex.

Import

为什么导入的网格附有 Animator 组件?

When Unity detects that an imported file has animation in its timeline, it will add an animation component on import. You can modify this in the asset’s import settings by setting the “Animation Type” to None in the import settings under the Rig tab. If necessary you can do this with several files at once.

图层 (Layers)

层的排序是否重要?

是的。层的优先级是按顺序从上到下的。层设置为 override 将始终覆盖先前的层(如果层有遮罩,则基于其遮罩)。

基础层的权重值是否应始终设置为 1?或者在使用其他层时权重是否应为 0?

基础层权重始终为 1,覆盖层将完全覆盖基础层。

有没有任何办法可以从控制器获取变量值而不使用名称字符串?

您可以使用整数来标识状态和参数。使用 Animator.StringToHash 函数来获取整数标识符值。例如:

runState = Animator.StringToHash("Base Layer.Run");
animator.SetBool(runState, false);

如果同步层中的状态与基础层中的相应状态相比具有不同的长度,会发生什么情况?

If layers are of different lengths, they will become unsynchronized. Enable the Timing option to force the timing of the states on the current layer, on the source layer.

Avatar Masks

有没有办法创建除 LeftFoot、RightFoot、LeftHand、RightHand 之外的 AvatarIKGoal?

有,支持膝盖和肘部 IK(反向动力学)。

有没有办法定义 Avatar 遮罩包含的变换组件?

Yes, for Generic clips you can define which transform animation is imported or not. For Humanoid clips, all human transforms are always imported and extra transforms can be defined.

Animations curves

具有曲线的动画如何与没有曲线的动画混合?

When you have an animation with a curve and another animation without a curve, Unity will use the default value of the parameter connected to the curve to do blending. You can set default values for your parameters, so when blending takes place between a State that has a Curve Parameter and one that does not have one, it will blend between the curve value and the default parameter value. To set a default value for a Parameter, simply set its value in the Animator Tool window while not in LiveLink.

动画过渡
Playables API