From 98bd42cf97e90102d169b488f707262137636d82 Mon Sep 17 00:00:00 2001 From: in0finite Date: Sun, 20 Oct 2019 20:17:06 +0200 Subject: [PATCH] fix for situation when LOD child is located in different render level --- Assets/Scripts/Behaviours/World/StaticGeometry.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Behaviours/World/StaticGeometry.cs b/Assets/Scripts/Behaviours/World/StaticGeometry.cs index b629016a..a42ece51 100644 --- a/Assets/Scripts/Behaviours/World/StaticGeometry.cs +++ b/Assets/Scripts/Behaviours/World/StaticGeometry.cs @@ -60,8 +60,11 @@ namespace SanAndreasUnity.Behaviours.World if (_canLoad && Instance.LodInstance != null) { - LodChild = dict[Instance.LodInstance]; - LodChild.LodParent = this; + if (dict.TryGetValue(Instance.LodInstance, out StaticGeometry dictValue)) + { + LodChild = dictValue; + LodChild.LodParent = this; + } } _isVisible = false;