diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-30 17:11:29 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-30 17:11:29 +0800 |
| commit | 6820cbf9a79016bb9f437a131af42d46aeb26adc (patch) | |
| tree | fd67f8f810ca4e356892e861f36accfbf823fd2c /Assets/Scripts/PlayerLocomotion.cs | |
| parent | 14a01125a885ee4dbd2de6c1f57bbcd12ca12110 (diff) | |
移除 PlayerLocomotion.cs 中 Rigidbody 的 VelocityY 影响
Diffstat (limited to 'Assets/Scripts/PlayerLocomotion.cs')
| -rw-r--r-- | Assets/Scripts/PlayerLocomotion.cs | 6 |
1 files changed, 5 insertions, 1 deletions
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. 更新动画参数 |
