Does hiding objects help performance?

I’m just wondering if i hide an object using code, will it use less resources

Nope
Imagine you have apple in your hand
And some wizard make it invisible
You can’t see it but you steel feel it in your hand and you still feel its weight

Same principal working for hiding objects
All process when it was visible still runs for that object only change is you don’t see it

1 Like

Ah interesting, i thought it could save some processing power? (Since you’re not showing its graphics)

I do not agree.

Hiding an object will slightly improve the performance because the object is not being rendered anymore, but the processing is still being done to that object.

But you don’t need to care for hiding off-screen objects, as they are already being culled by the engine. Consider deleting an object that you don’t need anymore to also free some processing power.

Read this documentation to know how you can optimize your game:
https://wiki.gdevelop.io/gdevelop5/tutorials/how-to-debug-poor-performance

Imagine someone comes here and ask how to improve performance in his game

I will suggest to delete all objects except player

Technically you will know i am right
But also technically you know that it is not method/solution author asked for
Actually that would defeat purpose of even making a game
But it will not change the fact my answer was accurate

Now in this specific case
You do get some performance gain from hiding objects
Yet technically if someone is asking for it
Most likely laggy game have so many objects or logic related to them that hiding objects will not help

It is not about who is right here
I can admit you are and i am not
And that won’t change the fact that hiding objects won’t help most users if not all

I dunno how GD handle the rendering part of 2D and 3d objects.
To my experience i guess that hide a 2d sprite object have 0 impact in game performance (if slightly means 0.001 ms), while i guess hide a 3D object should make sense.
I haven’t seen any thread here which solved performance problems hiding things.

also mosts of the times you would not hide objects for debugging purpouse