사망 시 체력바가 사라지지 않는 문제 수정

This commit is contained in:
2026-02-25 15:30:57 +09:00
parent 4804e78951
commit 75d2ef8dd0

View File

@@ -170,12 +170,16 @@ namespace Northbound
private void LateUpdate()
{
// 타겟을 따라 이동 (회전은 하지 않음)
if (_targetTransform != null)
// 타겟이 파괴되면 체력바도 파괴
if (_targetTransform == null)
{
transform.position = _targetTransform.position + Vector3.up * heightOffset;
Destroy(gameObject);
return;
}
// 타겟을 따라 이동 (회전은 하지 않음)
transform.position = _targetTransform.position + Vector3.up * heightOffset;
// 체력이 가득 차면 숨김
if (hideWhenFull && barContainer != null && _healthProvider != null && _initialized)
{