Coment about hidden layer

Hello!
It’s not a doubt, just a opinion.
I’m not sure I’m correct or not, or this is the correct place for this kind of post.
If not, sorry!
I think when a layer is hidden, logically, it should be inactive for any action.
Why do I need to use a condition such as: if layer X is visible > do this / if layer X is hidden > do that? It makes no sense.
Once it’s hidden it should be impossible to interact with it, even if you want to. It’s hidden, invisible.
Instead of this, if you have a hidden layer on your scene but click on a place where a button is on the hidden layer, it triggers the action you assign for that button. You need to use a condition to avoid that. Is it?
Very odd!

I use a custom keyboard for my card game.
The keyboard is a picture with hitboxes on a hidden layer on top.
So, if I cannot interact with the hitboxes anymore, what condition am I supposed to use to DO interact with those?

What if you had to use a condition just to activate the layer? It should be ignored by default.

thats what you do, use a condition to not interact with a layer. adding the condition is visible/not visible is by no means alot. and it makes sense.

but how would you archive interaction, if it would be deactivated by default?
what condition would you suggest?

While I can somewhat understand the ask, hiding a layer is no different than hiding an object.

There are too many use cases where requiring additional steps when a layer is hidden would break a ton of workflows. It is also not how amy other 2D engine works as far as I know.

Layers are purely visual, so hiding them does not impact logic by design. As slash mentioned, you need to make your logic check if the layer is visible, and it will accomplish what you are looking for, rather than requiring the inverse.

there actually is a small difference.
an object on a hidden layer does not have the “is visible” tag, so the condition “object is visible” does not work on objects on a hidden layer.

Maybe I’d like something like a “button” I used in flash, if you know what i mean. It was an object that you put on scene and it avoid you click anything behind it. It was very useful.

That sounds very unintuitive to me.
And is also more complex then just checking for visibility

Also wouldn’t really work that well.
Imagine you have a menu with 5 tabs (5 layers) hidden at the start and you click your tabs to show the corresponding layers.
A make stuff uninteractable button would be of no help here.

The condition layer is visible you only need 1 time and all interactions with the layer as subevents of it.
It’s little, intuitive, practical and I don’t see a good reason to change that.

Maybe I’m wrong and you’re right. Perhaps I need to to adapt myself with this. I used Flash for a very long time, and it’s not so easy to migrate to another complete different software. But it was a good talking!
Thanks!

No worries, and to be clear it’s not that your question/ask doesn’t make sense, its just the direct inverse of how the engine here (and other engines like Defold and Unity) are designed to work.

Visuals are separated from logic by design, since most of the time you want to still be able to manipulate the objects regardless of if they’re visible, by default.

What you ask is possible, you just need to add the extra condition that Slash mentioned to your events to avoid them getting fired off.

When you are used to do things in a certain way for a long time, you know how to plan it and make it work. I’m still planning things like I used to do in flash, that’s my problem, because when I’m going to implement my idea, the resources are completely different and I feel lost. But I’ll get there!
Thanks!

2 Likes