Closed Panicat closed 2 years ago
Regenerate the mesh with HandleGameModeGeneration() call in CelestialBodyGenerator. Due to LOD shenanigans, the changes may not be visible at first but they will be applied.
Regenerate the mesh with HandleGameModeGeneration() call in CelestialBodyGenerator. Due to LOD shenanigans, the changes may not be visible at first but they will be applied.
Thanks, I made the HandleGameModeGeneration() function public and called it from another script and also tried from inside the Update() of CelestialBodyGenerator...
...but even though the console says the mesh is generated I am unable to see the mesh. It simply isn't there? I don't know if it really takes that long to load but it appears to me like it isn't gonna happen. The Terrain Mesh game object is enabled and should be visible... (When I exit play mode it appears again) Any ideas?
As I said,
Due to LOD shenanigans, the changes may not be visible at first but they will be applied.
I haven't tried fiddling around with a proper fix, but as a work around you can just fly away from the planet and then come back with the enter key. The changes should be visible after that.
P.S. It could not be LOD stuff altogether but it's the only thing that comes to my mind for now anyway ;p
Hm, I had the ship disabled but even enabling it and going really far and back it's invisible. Collision still works.
I can get it to be visible by hitting V (triggering HandleGameModeGeneration() through the CelestialBodyGenerator Update function), and it appears at the lowest LOD setting. Basically a pyramid at that point. This only happens provided I haven't tried to call the function from another script, or I change the LOD setting to something else if I HAVE called it from another script. I guess it resets it and allows for it to be generated again? Not sure. Hopefully I'm making sense.
Huh, I called the generation method from other script too (Ship to be exact) and I observed exactly the same behaviour as I would from the generator script itself. I especially could not get this really weird LOD behaviour that you had, and everything works fine for me and becomes visible if I manually change the LOD too. (first to 2 and then to 0) Also, have you changed the LOD handling before in one way or another?
What exactly do you mean by LOD handling? Like alterring the code? If so then no, I don't know how most of the stuff in there works.
This issue is really weird indeed. If manually setting the LOD via SetLOD() doesn't help, then I don't know what do next. (as I said in my case everything works fine)
manually setting the LOD via SetLOD()
That seems to work nicely. Even for when calling from another script. I'll add it to the end of my randomising function and I should be good to go.
Thank you so much! Very much appreciated :) Nice that the code has so many potential ways to solve possible issues! Solved!
Even if the seed and everything changes, the planet doesn't change while playing. When the game stops the changes are applied. Is there any way to change such settings at runtime?
I need this for my project. Generally a way to instantiate randomised planets. The only way I could think of doing that is spawning one in then randomising the seeds? Thanks.