From d3fdef7bed851d7e585cfd3ced98dee34c8ea59f Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Fri, 22 May 2026 13:46:10 +0800 Subject: 按照罗师傅的方法修复了RootMotion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/AnimatorHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Assets/Scripts') 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); } } -- cgit