From 0e56408e17075c7f9e4680e8c280f6b1b895e8b1 Mon Sep 17 00:00:00 2001 From: swrring Date: Thu, 7 May 2026 17:47:00 +0900 Subject: [PATCH] =?UTF-8?q?BT5-Dev=20#33:=20else=20if(falling=20&&=20hit?= =?UTF-8?q?=3D=3Dnull)=20=ED=8F=90=EA=B8=B0=20+=20footRayDistance=200.5?= =?UTF-8?q?=E2=86=921.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [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 → 새 발판 활성 --- Assets/Scripts/Mechanics/PlatformDropThrough.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/Mechanics/PlatformDropThrough.cs b/Assets/Scripts/Mechanics/PlatformDropThrough.cs index 8765b3c..b16df30 100644 --- a/Assets/Scripts/Mechanics/PlatformDropThrough.cs +++ b/Assets/Scripts/Mechanics/PlatformDropThrough.cs @@ -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()