diff --git a/Assets/Scripts/GrassField.cs b/Assets/Scripts/GrassField.cs index b057a5b..adef5a7 100644 --- a/Assets/Scripts/GrassField.cs +++ b/Assets/Scripts/GrassField.cs @@ -77,13 +77,16 @@ public class GrassField : MonoBehaviour { private void Update() { #if UNITY_EDITOR - // update LOD distances (might have been changed via inspector) + // LOD distances might have been changed via Inspector -> Update materials + // Camera might have been moved -> Update LODs UpdateLODsAndMaterials(); #else if (_chunks.Length != numChunks * numChunks) return; var cam = Camera.main; if (!cam) return; - UpdateLODs(cam.transform.position, false); // while the game is running, only update the chunks near the camera + // while the game is running, only update the chunks near the camera + // if the camera moved a great distance since the last frame, this fails + UpdateLODs(cam.transform.position, false); #endif }