Fixed health bar glitches

This commit is contained in:
Pasha Bibko
2026-01-22 10:11:36 +00:00
parent fc629e45b6
commit 8a3aad807b

View File

@@ -9,7 +9,15 @@ namespace InterfaceOff.WorldScene
private void Update()
{
HealthBarObject.localScale = new Vector3(100f, (20 - Spawner.SpawnedWindowCount) * 5f, 100f);
float scale = (20 - Spawner.SpawnedWindowCount) * 5f;
scale = Mathf.Clamp(scale, 0f, Mathf.Infinity);
if (!Spawner.AutoSpawn)
{
scale = 0f;
}
HealthBarObject.localScale = new Vector3(100f, scale, 100f);
}
}
}