From 664607aff45a7d916eff94a81a3da939868376d3 Mon Sep 17 00:00:00 2001 From: swrring Date: Fri, 15 May 2026 12:10:53 +0900 Subject: [PATCH] =?UTF-8?q?fix(BT12-Dev):=20A06=20=EB=8F=85=20=EB=8A=AA=20?= =?UTF-8?q?Player=20fallback=20y=20-0.5=20(PD=20=EC=A7=80=EC=8B=9C=202026-?= =?UTF-8?q?05-15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PD 보고: "독늪이 플레이어 위치에서 생성될 경우 플레이어의 Y값에서 -0.5정도 아래의 위치에 생겨야할거 같아" 직전 commit 3c5a3bc 의 Player fallback ground Raycast 영역 — Player ground 위 발판 hit (예: -2.61) → spawn 위치 ground 표면. PD 의도는 Player.y - 0.5 직접 (시각 정합·발 아래 한 키 정도). 분기 정정: - nearest != null (지상 Enemy 후보): Enemy 위치 ground Raycast (기존 영역) - nearest == null (공격 가능 적 없음·Player fallback): spawnPos = (playerPos.x + OffsetXY.x, playerPos.y - 0.5 + OffsetXY.y) · ground Raycast 폐기 · PD 명시 수치 직접 검증 (Play 모드): - 비박쥐 13기 사망 + 박쥐 1기만 (IsFlying skip) - Player pos=(-15.14, -2.21) · OffsetXY=(0, -0.4) - Swamp pos=(-15.14, -3.11) = Player.y - 0.5 + OffsetXY.y(-0.4) 정합 OffsetXY는 PD Inspector 추가 미세 조정 영역 (현 -0.4). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Skills/Effectors/PoisonSwampSpawner.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/Skills/Effectors/PoisonSwampSpawner.cs b/Assets/Scripts/Skills/Effectors/PoisonSwampSpawner.cs index e7a285e..217c66a 100644 --- a/Assets/Scripts/Skills/Effectors/PoisonSwampSpawner.cs +++ b/Assets/Scripts/Skills/Effectors/PoisonSwampSpawner.cs @@ -45,15 +45,21 @@ namespace EerieVillage.Skills.Effectors if (d < minDist) { minDist = d; nearest = e; } } - Vector2 candidate = nearest != null ? (Vector2)nearest.transform.position : playerPos; - candidate += data.OffsetXY; - - // PD 지시 2026-05-15 — ground Raycast 영역 ground 영역 영역 spawn (공중 spawn 차단) - // groundLayerMask = Layer 0 (Level Tilemap) + Layer 16 (Floating 발판) - int groundLayerMask = (1 << 0) | (1 << 16); - RaycastHit2D groundHit = Physics2D.Raycast(candidate, Vector2.down, 20f, groundLayerMask); - if (groundHit.collider == null) return; // ground 미검출 — spawn 차단 - Vector2 spawnPos = new Vector2(candidate.x, groundHit.point.y); + Vector2 spawnPos; + int groundLayerMask = (1 << 0) | (1 << 16); // Level Tilemap + Floating 발판 + if (nearest != null) + { + // 지상 Enemy 영역 — Enemy 위치 ground Raycast (정확한 ground.y) + Vector2 candidate = (Vector2)nearest.transform.position + data.OffsetXY; + RaycastHit2D groundHit = Physics2D.Raycast(candidate, Vector2.down, 20f, groundLayerMask); + if (groundHit.collider == null) return; + spawnPos = new Vector2(candidate.x, groundHit.point.y); + } + else + { + // PD 지시 2026-05-15 — 공격 가능 적 없을 시 Player.x 위치·Player.y - 0.5 직접 (ground Raycast 영역 X) + spawnPos = new Vector2(playerPos.x + data.OffsetXY.x, playerPos.y - 0.5f + data.OffsetXY.y); + } // 독 늪 GO spawn (OnHitFxPrefab = FX_Venom_Swamp) GameObject swampGo;