diff --git a/Assets/Scripts/Gameplay/PlayerEnemyCollision.cs b/Assets/Scripts/Gameplay/PlayerEnemyCollision.cs index 3457d2b..8a41556 100644 --- a/Assets/Scripts/Gameplay/PlayerEnemyCollision.cs +++ b/Assets/Scripts/Gameplay/PlayerEnemyCollision.cs @@ -36,22 +36,24 @@ namespace Platformer.Gameplay { if (player == null || player.health == null || enemy == null) return; - // BT5-Dev #25 — Player 발이 Enemy 머리 영역 영역 영역 영역 발동 (footHeadDelta 영역 영역 영역 영역) - bool stomped = dyAtCollision > STOMP_DELTA_MIN && dyAtCollision < STOMP_DELTA_MAX; + // BT5-Dev #37 — PD 의도 정확 반영: 점프 상태(공중) + Player.y > Enemy.y = 무조건 밟기 + // footHeadDelta 좁은 영역(-0.3~0.05) 빠른 떨어짐 한 프레임 miss → 점프+위 단순 조건으로 catch 보장 + bool inAir = !player.IsGrounded; + bool playerAbove = player.transform.position.y > enemy.transform.position.y; - Debug.Log($"[PEC] stomped={stomped} delta={dyAtCollision:F2} (range {STOMP_DELTA_MIN}~{STOMP_DELTA_MAX}) pInvuln={player.health.IsInvulnerable}"); + Debug.Log($"[PEC] inAir={inAir} above={playerAbove} delta={dyAtCollision:F2} pY={player.transform.position.y:F2} eY={enemy.transform.position.y:F2}"); - if (stomped) + if (inAir && playerAbove) { + // 점프 + Enemy 위 = 밟기 (Bounce + EnemyDeath) Schedule().enemy = enemy; player.Bounce(player.jumpTakeOffSpeed / 3f); return; } - // BT5-Dev #35 — 점프 상태(공중) 측면 충돌 시 피해 X 방어 코드 (PD 지시) - if (!player.IsGrounded) + if (inAir) { - Debug.Log($"[PEC] 점프 상태 측면 충돌 영역 피해 차단 (delta={dyAtCollision:F2})"); + // 점프 + Enemy 옆·아래 = 피해 차단 (방어 코드) return; }