Changing storage during runtime #428
-
I'm attempting to change the map that a Terrain3D node is rendering during runtime.
Which leads to a crash whenever this is attempted. Is there currently a way to alter the terrain display during runtime? The alternative would be creating scenes for each map and instancing them, which could be questionable depending on how many are needed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
The editor is runtime and it can swap in and out different storage files without issue. There's no difference. The editor is certainly doing something you could do but are not.
You can load that file and the other file in the editor, and swap them in and out without issue? I would type it Terrain3DStorage, and use set_storage().
At the least, it shouldn't crash. You can enable debug logging and trace activity before the crash. You can also compare the log between changing res files in the editor vs your code to see what is different. If you're building from source you can debug and capture the exact line it breaks on.
We're doing this. Storage is changing dramatically in PR #374 and 0.9.3. |
Beta Was this translation helpful? Give feedback.
I added this to the bottom of
CodeGenerated.gd
and it worked just fine. There was also no issue if I commented the timer (processing on the same frame).Your issue might be with Godot's C# code and you probably need to do some debugging with both the Terrain3D and Godot source. When setup, it's pretty easy to run through the MSVC debugger and have it stop on the exact line with the issue. You want to confirm if we have a problem in Terrain3D. I think the above strongly suggests no.