So I’m working on the UI widget and all the buttons the are under a Canvas Panel are unclickable. They all work when I take them outside of the Canvas Panel.
Why?
‘Canvas Panel’ is the name for a folder in a Widget Blueprint editor, right? So it shouldn’t affect anything…
Canvas panel is not a folder, it is a widget which can hold widgets. A panel with the specific feature that any widgets contained by it can be positioned easily.
If the buttons being “under” means contained by it, it should not matter.
Else, a widget might be on top of your buttons and taking the click events. You can check the “Visibility” property, if a widget says “Visible” it can consume the mouse click.
Ah that is unusual, normally you’d focus on one interactive widget at the time like a single button, that is also how the widget system is designed. You could create a UserWidget to hold several buttons using NamedSlots and register the click on the UserWidget, then from there call any activation logic on the buttons.
I think OP is describing a situation where one Widget with a Canvas is created and placed into the Viewport (such as a menu). Then another Widget with a Canvas is created and placed into the Viewport (such as a chat dialog?). When the Chat Dialog is active, the Option Menu is unclickable.
This would be because the z-order of the canvas is such that the Option Menu is behind the Chat Dialog and the click events cannot pass through. This makes the Option Menu unclickable.
^ If I’m right (for future readers) I think the solution would be:
Instead of programmatically adding widget’s with their own canvases to the viewport – programmatically add overlays, or buttons, etc to a single canvas using some kind of manager/controller.
You can add anything you want in any way just ensure that the visibility property of the widget is set to “not hit testable” so you can’t navigate to it and can’t click on it. your click will go through it.