From eb91c1dfe1981543cd3f90225335bf5127ae9101 Mon Sep 17 00:00:00 2001 From: BOT Alex <44818698+MagicBOTAlex@users.noreply.github.com> Date: Sun, 21 Apr 2024 11:46:44 +0200 Subject: [PATCH] Fixed my error --- Assets/Scripts/PlacementSystem/SlotManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/PlacementSystem/SlotManager.cs b/Assets/Scripts/PlacementSystem/SlotManager.cs index d206d21..353576a 100644 --- a/Assets/Scripts/PlacementSystem/SlotManager.cs +++ b/Assets/Scripts/PlacementSystem/SlotManager.cs @@ -11,7 +11,7 @@ public class SlotManager : MonoBehaviour public HealthComponent TowerHealth; - public bool IsOccupied => TowerHealth.TryGetComponent(out HealthComponent _); + public bool IsOccupied => TowerHealth != null && TowerHealth.TryGetComponent(out HealthComponent _); public Transform TowerSpawnPoint;