From 6820cbf9a79016bb9f437a131af42d46aeb26adc Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Sat, 30 May 2026 17:11:29 +0800 Subject: 移除 PlayerLocomotion.cs 中 Rigidbody 的 VelocityY 影响 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/PlayerLocomotion.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Assets/Scripts/PlayerLocomotion.cs') diff --git a/Assets/Scripts/PlayerLocomotion.cs b/Assets/Scripts/PlayerLocomotion.cs index 61eef1f..449dfc7 100644 --- a/Assets/Scripts/PlayerLocomotion.cs +++ b/Assets/Scripts/PlayerLocomotion.cs @@ -160,7 +160,11 @@ namespace DS Vector3 projectedVelocity = Vector3.ProjectOnPlane(baseVelocity, _normalVector); // 设置 Rigidbody 速度(物理驱动移动) - rigidbody.velocity = projectedVelocity; + rigidbody.velocity = new Vector3( + projectedVelocity.x, + // 保留原始的 Velocity Y + rigidbody.velocity.y, + projectedVelocity.z); // ---------------------------------------------------------- // 4. 更新动画参数 -- cgit