From aad1b4e0edc9c5e3dac83fbce4fe3a0ba2d84420 Mon Sep 17 00:00:00 2001 From: swrring Date: Fri, 8 May 2026 11:47:17 +0900 Subject: [PATCH] =?UTF-8?q?BT5-Dev=20#84:=20=EC=88=98=ED=8F=89=20Raycast?= =?UTF-8?q?=20=EC=8B=9C=EC=9E=91=20=EC=98=81=EC=97=AD=20=EC=99=B8=EB=B6=80?= =?UTF-8?q?=20=EC=A0=95=EC=A0=95=20(BT83=20=EA=B1=B0=EC=A7=93=20=EC=96=91?= =?UTF-8?q?=EC=84=B1=20=EC=B0=A8=EB=8B=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PD 보고 (2026-05-08): "이제는 모든 몬스터가 이동(순찰 패턴)하지 않고 있어" 근본 원인: - BT83 wallOrigin = bounds.center.x + moveDir * 0.05 = Capsule bounds 내부 - Enemy가 Foreground Tile 위 영역에 서있을 때 = 인접 Tile (같은 Layer 16) Raycast 검출 - = 거짓 양성 → 즉시 다음 phase 강제 → 매 frame 반복 → patrol X 정정 (BT84): - wallOrigin.x = bounds.center.x + moveDir * (halfWidth + 0.05f) - = Capsule bounds 외부 영역 시작 → 자기 영역(또는 같은 Tile) 검출 X - 절벽 검출 영역 그대로 (footAhead 영역은 발 앞 cliffCheckDistance·다른 영역) 효과: - Enemy 영역 자기 검출 X = 거짓 양성 차단 - 벽 영역 정상 검출 (외부 영역만) - patrol 정상 작동 후속 의무: - PD Refresh+Play 시각 검증 --- Assets/Scripts/Mechanics/EnemyController.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Mechanics/EnemyController.cs b/Assets/Scripts/Mechanics/EnemyController.cs index 45865f3..53e2735 100644 --- a/Assets/Scripts/Mechanics/EnemyController.cs +++ b/Assets/Scripts/Mechanics/EnemyController.cs @@ -132,12 +132,14 @@ namespace Platformer.Mechanics } _lastX = transform.position.x; - // BT83 — 수평 벽 검출 (PD 보고 2026-05-08): 벽 가장자리 미세 밀림 → 절벽 떨어짐 차단 - // 발 영역 horizontal Raycast Layer 0+16 검출 시 = 벽 → 다음 phase 즉시 강제 + // BT84 — 수평 벽 검출 정정 (PD 보고 2026-05-08): BT83 거짓 양성 차단 + // BT83 시작 영역(bounds 내부)이 Foreground Tile 위에서 옆 Tile 검출 → 거짓 양성 → patrol X + // 정정: Raycast 시작 영역 = Capsule bounds 외부 (자기 검출 X) if (Mathf.Abs(dx) > patrolArriveThreshold && _collider != null) { + float halfWidth = _collider.bounds.extents.x; Vector2 wallOrigin = new Vector2( - _collider.bounds.center.x + moveDir * 0.05f, + _collider.bounds.center.x + moveDir * (halfWidth + 0.05f), _collider.bounds.center.y ); RaycastHit2D wallHit = Physics2D.Raycast(wallOrigin, new Vector2(moveDir, 0), wallCheckDistance, groundLayerMask);