-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling collision increases memory consumption each time the scene is reloaded. #397
Comments
Godot should free the memory if you free the scene before reloading it. We have no problem swapping out Terrain3D levels in Out of the Ashes. Collision takes a lot of memory. It will be addressed by #278. |
I have observed this as well. I am freeing the entire scene using OP, can you provide some more details? |
You both could test debug collision, which uses a static body instead of the physics server. You could repeatedly enable and disable debug collision in the editor and see if it leaks memory. You can test a scene with only Terrain3D in it, or try to replicate it in the demo. We don't use change_scene_to_packed. We have our scene loader as the main scene in the tree, which never changes. Our scene loader loads a scene, attaches it to the SL or removes and frees it. |
Placing the Terrain3d node as a child of the global node solved the problem for now. Switching scenes may cause the LOD to not function properly, so you need to set up a dummy camera in Terrain3d before switching scenes and then set up an active camera in the scene after switching scenes. |
Your player and camera can also be global. Ours is. There's no need to store your player within levels, or reload them when switching. You can specify any camera at any time with Terrain3D.set_camera(). |
Terrain3D version
v0.9.1-beta
System information
Godot_v4.2.2-stable Vulkan Forward+
Is the issue reproducable in the demo?
Yes
Issue description
Each time I reload a scene with terrain placed, memory consumption increases. Disabling collisions does not cause this problem. The same problem occurred when exporting to an executable file.
https://github.com/TokisanGames/Terrain3D/assets/172058970/7bcd7477-8c79-4e1f-8a7d-46aa58bf89f9
Logs
No errors displayed in console
The text was updated successfully, but these errors were encountered: