BT5-Dev #84: 수평 Raycast 시작 영역 외부 정정 (BT83 거짓 양성 차단)
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 시각 검증
This commit is contained in:
parent
4603fdf947
commit
aad1b4e0ed
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue