BT5-Dev #33: else if(falling && hit==null) 폐기 + footRayDistance 0.5→1.0

[BT32-StartHit] dist=0.54 영역 = Player 시작 위치 0.54m 위. footRayDistance 0.5 영역 → 첫 Update raycast hit X(0.54>0.5) → else if 영역 → IgnoreCollision(true) 복구 → 통과 → 떨어짐

본 PM 자인:
- Start raycast 정상 활성 → 직후 Update raycast 거리 부족으로 hit miss
- else if 영역 = 발판 떠남 시 활성 해제 → Player 거리 잠시 벗어나도 활성 해제 = 떨어짐 직접 원인

정정:
- footRayDistance 0.5 → 1.0 (Player 시작 위치 영역 충분 커버)
- Update else if(falling && hit.collider==null && _activePlatform!=null) 영역 폐기 (활성 해제 = rising 시점만)

동작:
- Start 시 Level 영역 충돌 활성
- 떨어짐 영역 raycast 거리 일시 벗어나도 활성 유지 (떨어짐 차단)
- 점프(rising) 시 IgnoreCollision(true) 복구 = 통과
- 하강(falling) + 새 발판 hit → 새 발판 활성
This commit is contained in:
깃 관리자 2026-05-07 17:47:00 +09:00
parent 5e796cc5e2
commit 0e56408e17
1 changed files with 3 additions and 8 deletions

View File

@ -14,7 +14,7 @@ namespace Platformer.Mechanics
const int JUMP_THROUGH_LAYER = 8;
[Tooltip("발 raycast 기본 거리. velocity 영역에 따라 동적 확대.")]
public float footRayDistance = 0.5f;
public float footRayDistance = 1.0f;
Collider2D _self;
KinematicObject _ko;
@ -70,7 +70,7 @@ namespace Platformer.Mechanics
if (rising)
{
// 점프 → 활성 발판 통과 복구
// BT5-Dev #33 — 활성 해제 = 점프(상승) 시점만. 발판 떠남(낙하)은 활성 유지 (Player 거리 영역 벗어나도 충돌 유지·복구)
if (_activePlatform != null)
{
Physics2D.IgnoreCollision(_self, _activePlatform, true);
@ -83,12 +83,7 @@ namespace Platformer.Mechanics
Physics2D.IgnoreCollision(_self, hit.collider, false);
_activePlatform = hit.collider;
}
else if (falling && hit.collider == null && _activePlatform != null)
{
// 발판 떠남 (낙하) → 활성 해제
Physics2D.IgnoreCollision(_self, _activePlatform, true);
_activePlatform = null;
}
// BT33 — falling + hit X 영역 활성 해제 영역 폐기 (raycast 거리 일시 벗어남 영역 통과 복구 차단)
}
void OnDrawGizmosSelected()