0 votes

Hi! Suppose you have a fairly large structure in your level which is a tscn containing quite a few meshes and colliders in it, and you want that whole tscn to constantly rotate. You attach a script to it to rotate.
Now here's the question. If you set that tscn to .hide, will Godot still calculate the rotating meshes in the background? Or will it only start doing so once you set the scene to .show?
(I am thinking or showing scenes only when they enter an area attached to the character, to aid performance. The other idea is to place position markers , eg. spatial nodes, all over the level and only add objects as children of said markers when you get closer to them)

asked Feb 25 in Engine by Macryc (242 points)

1 Answer

0 votes
Best answer

When you hide a mesh, it won't be rendered anymore but its octree (used for frustum culling) will still be calculated. This shouldn't be an issue unless you have a ton of meshes, still. If you want to avoid this, you have to remove the node from the scene entirely. remove_child() should be enough, but if it isn't, you may have to use queue_free() instead.

answered Feb 25 by Calinou (5,924 points)
selected Feb 26 by Macryc
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.