BT5-Dev #43: IsGrounded 영역 폐기·footHit 단독 + 점프 영역 OFF 강제 (시작 떨어짐 차단)

PD 보고: 시작 시 떨어짐

자인:
- BT42 IsGrounded 조건 영역 → 게임 시작 frame 0 IsGrounded=false (KinematicObject 영역 영역 영역 PerformMovement 결과) → standingOnPlatform=false → mask OFF → 발판 영역 영역 → 떨어짐

정정:
- IsGrounded 조건 폐기
- footHit 단독 판정 (Player 발 ↓ 0.1m raycast Layer 16 hit → 발판 위 영역)
- 점프 영역 (jumpState=Jumping || InFlight+velocity.y>0) → standingOnPlatform=false 강제 (점프 시작 시 발판 영역 차단)

동작:
- 게임 시작 → footHit 영역 (Player 발판 위 영역) → standingOnPlatform=true → mask ON → 정착
- 걷기 옆 (footHit X) → standingOnPlatform=false → mask OFF → 통과
- 점프 (Jumping/InFlight+상승) → standingOnPlatform=false 강제 → mask OFF → 통과
- 하강 후 발판 위 (footHit) → standingOnPlatform=true → 착지
This commit is contained in:
깃 관리자 2026-05-07 18:28:29 +09:00
parent fc243453fe
commit 41c4b9e506
1 changed files with 5 additions and 2 deletions

View File

@ -204,9 +204,12 @@ namespace Platformer.Mechanics
{
int baseMask = Physics2D.GetLayerCollisionMask(gameObject.layer);
// BT5-Dev #42 — PD 의도: 발판 위 착지(서있는) 영역만 충돌 ON, 걷기·점프·측면 영역 모두 통과
// BT5-Dev #43 — IsGrounded 영역 폐기 (frame 0 미설정 → 떨어짐). footHit 단독 + 점프 영역 OFF 강제
bool isJumpingThrough = jumpState == JumpState.Jumping
|| (jumpState == JumpState.InFlight && velocity.y > 0.01f);
bool standingOnPlatform = false;
if (collider2d != null && IsGrounded)
if (collider2d != null && !isJumpingThrough)
{
Vector2 footPos = new Vector2(collider2d.bounds.center.x, collider2d.bounds.min.y + 0.02f);
int jumpThroughMask = 1 << JUMP_THROUGH_LAYER;