summaryrefslogtreecommitdiff
path: root/Assets/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/Test/RootConstainTest.cs12
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;