diff --git a/project/Terkoiz.MapZoneHighlighter/BoundedBoxes/ColliderBoundsController.cs b/project/Terkoiz.MapZoneHighlighter/BoundedBoxes/ColliderBoundsController.cs index 20de414..fc9fbf2 100644 --- a/project/Terkoiz.MapZoneHighlighter/BoundedBoxes/ColliderBoundsController.cs +++ b/project/Terkoiz.MapZoneHighlighter/BoundedBoxes/ColliderBoundsController.cs @@ -52,6 +52,11 @@ namespace Terkoiz.MapZoneHighlighter.BoundedBoxes private void OnGUI() { + if (Camera.main == null) + { + return; + } + ScreenPosition = UIDrawingUtil.WorldPointToScreenPoint(transform.position); IsOnScreen = UIDrawingUtil.IsScreenPointVisible(ScreenPosition); DistanceToCamera = Vector3.Distance(Camera.main.transform.position, transform.position);