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
Show or Hide layer does not show or hide objects from that layer for Conditions #2883
Comments
I would say that currently this "works as intended" as hiding/showing an object is different from hiding/showing a layer. |
The logic shouldn't be that visibility has to be inherited from the layer? It makes more sense, the object isn't visible, it's hidden due to the layer, if the object condition "is visible" return true while the object isn't visible, it's a bit weirdy, don't you think? |
@Bouh I agree with you that the visibility from objects on a layer should be derived from the layer itself. However, If this is currently intended logic, I'd guess any change to its default behavior would be a breaking change if anyone has ever used it expecting it to work as it does today. @4ian WIth the above in mind, is there no way to add an additional parameter to the show/hide layer actions of "Also show/hide all objects on this layer? Yes/no" With it defaulting to no? That would keep existing behavior as default, but help users avoid a massive quantity of events to hide their objects as well. If not, then the description verbiage probably needs to be extended to explicitly say something like "Note: This setting changes visibility of the entire layer. Objects on the layer will not be treated as "hidden" for event conditions or actions." |
Hello 👋 Instead of changing that behavior, I've added the description you've suggested @Silver-Streak to avoid confusion 👍 |
Describe the bug
When you use the "Show/Hide Layer" action, while all of the objects are visually hidden from the game, from a logic perspective they're still not treated as hidden.
To Reproduce
Steps to reproduce the behavior:
Here's the GUI layer hidden:
Here's the left text object on the GUI layer (while the layer is hidden), still showing 'Is hidden?" as false.
PlatformerBUG.zip
I've tweaked an existing project that was built by someone for the vertical moving platform bug to show this.
A to hide the layer, D to show it.
W to hide the left text object, E to show it.
The platform is tinted green when the left text object is visible, red when it's hidden.
The object is treated as visible unless you manually hide it.
You can work around this by setting up some events that checks for the visibility of an object's layer using expressions, then hiding the object if it is still visible, but this seems like a messy solution if you have a lot of objects.
If this behavior is intentional, it can cause some issues for users that want to hide a large quantity of objects, or use object visibility conditions to do object selection. In this case, I'd recommend adding a parameter to the show/hide layer actions for whether the user wants to also treat the objects as hidden. Default it to "no" to keep current default functionality.
Other details
OS: Windows 10 pro
GD5 version: B114
Extra context: Found this while trying to help Creativesamurai on the discord deal with layer-based menus.
The text was updated successfully, but these errors were encountered: