aboutsummaryrefslogtreecommitdiff
path: root/Assets/Scripts
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-22 13:46:10 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-22 13:46:10 +0800
commitd3fdef7bed851d7e585cfd3ced98dee34c8ea59f (patch)
treebca164dd3beac0d70af0349caaece39184d96416 /Assets/Scripts
parent905b0c36301e96feabac6cd3e2a51252b075ef66 (diff)
按照罗师傅的方法修复了RootMotion
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/AnimatorHandler.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Assets/Scripts/AnimatorHandler.cs b/Assets/Scripts/AnimatorHandler.cs
index f285dca..de1af4c 100644
--- a/Assets/Scripts/AnimatorHandler.cs
+++ b/Assets/Scripts/AnimatorHandler.cs
@@ -142,7 +142,7 @@ namespace DS
{
// 获取当前帧的根运动位移向量
var rootMotion = GetRootMotion();
-
+
// 输出调试日志,用于查看根运动数据
Debug.Log(rootMotion);
@@ -178,6 +178,7 @@ namespace DS
// Vector3.ProjectOnPlane 会去除向量中沿法线方向的分量
// 这样只保留水平方向的位移,避免 Y 轴上的微小波动影响角色位置
// return Vector3.ProjectOnPlane(animator.velocity, normalVector);
+ // return Vector3.ProjectOnPlane(animator.velocity, normalVector);
return Vector3.ProjectOnPlane(animator.velocity, normalVector);
}
}