Prevent Control from blocking other Control nodes?
Asked Answered
C

4

0

My game has an auto-loaded pause menu, allowing it to be accessed from any scene. When I test the pause menu scene on its own, the buttons work fine. However, when testing my game's debug level, the buttons on the pause menu can only be clicked on the far left edge.

By disabling my HUD, I was able to determine that the HUD is blocking the mouse from clicking on the buttons on the pause menu. I'm aware that I can fix this by changing the order of the control nodes, but I would prefer to keep my game's current node structure, so I want to avoid moving the HUD from where it currently is.

Is there a way to prevent the pause menu from blocking the HUD, without changing the order of these control nodes?

Cupulate answered 2/2, 2020 at 8:5 Comment(0)
C
0

I think in the inspector panel you can disable mouse events from the HUD (either altogether or when opening the pause menu)

Cimabue answered 2/2, 2020 at 12:1 Comment(0)
C
0

I do see the "Mouse/Filter" option in the inspector, but none of the three options seem to make a difference. Is that what you're referring to? My HUD is purely visual, it shouldn't be receiving any input whatsoever.

Cupulate answered 3/2, 2020 at 8:4 Comment(0)
C
0

Ah okay, maybe that button doesn't do what I thought. Can you try setting disabled to true, maybe that will stop the blocking.

Cimabue answered 3/2, 2020 at 8:43 Comment(0)
S
0

You can set the layer property on the CanvasLayer to achieve this.

I ran into this today (HUD apparently blocking my Pause Menu's buttons, both on canvas layers). After debating how to rearrange the scene tree to get the pause menu in front, i realized the answer is actually provided by the CanvasLayer's layer property - just need to set the PauseMenu's layer to something higher than the HUD's layer.

Shorthand answered 8/11, 2023 at 21:9 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.