diff options
author | chai <chaifix@163.com> | 2020-10-14 07:45:27 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-14 07:45:27 +0800 |
commit | 41a924d317b4b0b9c5e53d4c4ca53cb55ea80fd2 (patch) | |
tree | 464555fb3c65ac08831b1fbc0f14cb0535abe09f /Assets/Scripts | |
parent | 0a84de586c479a32959bd30fbf1a05abac1557e1 (diff) |
*#Erika#动画最佳设置:
* Root Transform Rotation 永远勾上 Bake Into Pose, BasedUpon Original
* 对于idle动画和其他位置不会改变的动画,Y和XZ都bake,BasedUpon Feet
* 对于平地上移动的动画,Bake Y position,XZ不要bake
* 对于Y轴改变的动画,比如跳跃、某些浮空技能,Y和XZ都不要bake
Diffstat (limited to 'Assets/Scripts')
-rw-r--r-- | Assets/Scripts/Test/RootConstainTest.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Assets/Scripts/Test/RootConstainTest.cs b/Assets/Scripts/Test/RootConstainTest.cs index 4cd9dbb1..91d37062 100644 --- a/Assets/Scripts/Test/RootConstainTest.cs +++ b/Assets/Scripts/Test/RootConstainTest.cs @@ -23,8 +23,16 @@ public class RootConstainTest : MonoBehaviour // 约束z=0
if (animator)
{
- //animator.ApplyBuiltinRootMotion();
- transform.position += new Vector3(animator.deltaPosition.x, animator.deltaPosition.y, 0);
+ Vector3 position = transform.position;
+ position.x += animator.deltaPosition.x;
+ position.y += animator.deltaPosition.y;
+ //position.y = Mathf.Max(0, position.y);
+ //position.y = 0;
+
+ transform.position = position;
+
+ transform.rotation *= animator.deltaRotation;
+
//transform.forward = animator.deltaRotation * transform.forward;
//Vector3 euler = animator.deltaRotation.ToEuler();
//euler.x = euler.z = euler.y = 0;
|