Hi, I would really like to have an option to hide/show and enable/disable gameobjects, mostly for debugging purposes, but also if you have a collection, and that collection has a big say sprite that covers the entire screen, and You want to edit the content below it it would be very useful if you could hide / show it to access the stuff below it, also if you want to test a game and something is throwing errors, or you want to temporarily remove an object form the game for testing it would be usefull to have a enable/disable checkbox.
Hi!
One thing I often do for the same effect is simply set the z layer to 100. As the engine only renders sprites with z layers between 1 and 0, the sprite is not rendered. That may help in your situation.
Hmm, yeah, maybe the components that support enable and disable messages could have a checkbox in the editor that will disable the component both in the editor but also when the application is running.
Thanks! Great idea, it still would be nice to have a checkbox of something but I’ll use this in the meantime
One thing I often do for the same effect is simply set the z layer to 100
Does anyone have a workaround that works in Defold 2.0?
I used to use the trick above to hide objects but with the 2.0 version of Defold, it renders all objects in the editor regardless of the Z position.
Setting z value to 100 will not work in the editor itself (editor 1 or 2). It’s the render script that determines what to draw and what to exclude. The default is a range of -1 to 1.
In Editor 1.0, setting the Z index to -5 for example would actually make the object disappear from the editor view (and the game). In 2.0, its always shown in editor.
It does? I’m not able to repeat that in Editor 1:
(And the sprite’s z value is 0)
Sorry it appears you’re right – I was misinterpreting the behavior.
So in Defold 1.0, a large background image I had was hiding whatever was under it (at -5).
In Defold 2.0 however, in the same project you can see through the background and see the things under it.
It also appears that 2.0 also shows a representation of everything in a GUI file in it so its even more cluttered for me in the main.collection
Here’s a video demonstration of the 2 versions (v2 is the dark UI one):
Yes, I’ve also noticed that Editor 2 renders stuff in the wrong order in the scene view. I tried searching the Editor 2 Issues but couldn’t find a bug report for this. @Erik_Angelin, do you know if it’s a known problem or not?
Another workaround would be setting scale of a sprite component or game object to Zero.