From bf5a89c6cbe24ab860a2596cf0e721fa0ff7ebc5 Mon Sep 17 00:00:00 2001 From: swrring Date: Fri, 8 May 2026 00:28:29 +0900 Subject: [PATCH] =?UTF-8?q?BT5-Dev=20#70:=20Drop-Through=20=EB=B0=9C?= =?UTF-8?q?=ED=8C=90=20=EC=9C=84=20=EA=B2=80=EC=A6=9D=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20(=EC=A7=80=EB=A9=B4=20=EC=9C=84=20=EC=A0=90=ED=94=84=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=A0=95=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PD 보고 (2026-05-08): "아래가 뚫려있지 않은 지형에서 아래로 점프 시도 시 점프가 되지 않는 버그" 근본 원인: - BT69 코드: Down + Jump 입력 시 무조건 dropThroughTimer + dropThroughJump 활성 - ComputeVelocity: dropThroughJump=true 시 velocity.y=0 강제 (위 점프 X) - = 지면(Layer 0) 위 Down + Jump → velocity.y=0 → 점프 자체 차단 정정 (Update 영역에 발판 위 검증 추가): - Down + Jump 입력 시 footHit Raycast (Layer 16 mask 0.1m 아래) - onJumpThroughPlatform = (footHit.collider != null) - Drop-Through 발동 조건: downHeld AND onJumpThroughPlatform - = 발판(Layer 16) 위만 Drop-Through 발동 - = 지면(Layer 0) 위 = 일반 점프 (velocity.y = jumpTakeOffSpeed) 효과: - 발판 위 + Down + Jump → 발판 통과 + 점프 모션 + 자연 낙하 (BT69 영역 그대로) - 지면 위 + Down + Jump → 일반 점프 (위로) ✅ (정정) - Down 미입력 + Jump → 일반 점프 (그대로) 후속 의무: - PD Refresh+Play 시각 검증 - 정합 시 BT69 + BT70 결합 = Drop-Through Input 패턴 영구 채택 --- Assets/Scripts/Mechanics/PlayerController.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Mechanics/PlayerController.cs b/Assets/Scripts/Mechanics/PlayerController.cs index 5fc89c7..d4af670 100644 --- a/Assets/Scripts/Mechanics/PlayerController.cs +++ b/Assets/Scripts/Mechanics/PlayerController.cs @@ -146,8 +146,18 @@ namespace Platformer.Mechanics if (jumpState == JumpState.Grounded && m_JumpAction.WasPressedThisFrame()) { // BT69 — Down + Jump = Drop-Through (PD 명시 2026-05-08) + // BT70 — 발판(Layer 16) 위 검증 추가 (PD 보고 2026-05-08: 지면 위 Down + Jump = 점프 X 버그) + // 발판 위만 Drop-Through 발동·지면 위 = 일반 점프 bool downHeld = moveInput.y < -0.5f; - if (downHeld) + bool onJumpThroughPlatform = false; + if (downHeld && collider2d != null) + { + Vector2 dropFootPos = new Vector2(collider2d.bounds.center.x, collider2d.bounds.min.y + 0.02f); + int jumpThroughMask = 1 << JUMP_THROUGH_LAYER; + RaycastHit2D dropFootHit = Physics2D.Raycast(dropFootPos, Vector2.down, 0.1f, jumpThroughMask); + onJumpThroughPlatform = dropFootHit.collider != null; + } + if (downHeld && onJumpThroughPlatform) { dropThroughTimer = DROP_THROUGH_DURATION; dropThroughJump = true;