diff options
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. 更新动画参数 |
