BT5-Dev #70: Drop-Through 발판 위 검증 추가 (지면 위 점프 버그 정정)

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 패턴 영구 채택
This commit is contained in:
깃 관리자 2026-05-08 00:28:29 +09:00
parent 643d1ae9a0
commit bf5a89c6cb
1 changed files with 11 additions and 1 deletions

View File

@ -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;