SebLague / Procedural-Landmass-Generation

Procedural Landmass Generation in Unity
https://www.youtube.com/playlist?list=PLFt_AvWsXl0eBW2EiBtl_sxmDtSgZBxB3
MIT License
1.1k stars 596 forks source link

UnityException: SetFloatImpl can only be called from the main thread. #39

Open Afterlife301209 opened 2 years ago

Afterlife301209 commented 2 years ago

I am getting this error AND I TRIED EVERYTHING TO FIX IT : UnityException: SetFloatImpl can only be called from the main thread.

LarsThePenguin commented 2 years ago

I have the same problem

mattsteffey commented 9 months ago

In MapGenerator, copy this line: textureData.UpdateMeshHeights(terrainMaterial, terrainData.minHeight, terrainData.maxHeight);

And then delete it. Paste it as the first line in the existing DrawMapInEditor() and also create a private void Awake() and put it there as well. Should fix you right up.