Hey!
So I think I’ve run into a bug with the experimental 3d widgets (in 4.7.5), and their visibility. The bug is that if a 3d widget has its visibility set to “Hit Test Invisible” or “Self Hit Test Invisible”, it still captures the cursors click.
A repro:
-
Open up a blank 2D sidescroller blueprint project.
-
Add a new player controller, tick the show mouse cursor, enable click events and enable mouse over events boxes, and set this controller class as the gamemode controller.
-
Create a new widget, 100 x 100, with just a button filling up all the space, and have the button print a string when clicked.
-
Create a new actor blueprint, add a widget component, set it to the class of widget we just made, set the pivot point to (0,0).
-
Convert the ledge the player starts on to a blueprint and have it print a different string when clicked (make sure it blocks visibility in its collision settings).
-
In the character BP, make a node for on F pressed, and have it spawn an instance of the BP with the widget on it, setting the transform so that is over the top of the ledge instance in the level (you’ll need to make sure the Y component of the location is at least 50 units towards the camera from the ledge or you’ll get different results).
-
Set the visibility on the button to visible, and play. You’ll be able to click the button and it’ll print a string.
-
Change the visibility of the button to “Hit Test Invisible” (the tooltip of which states that the cursor hit tests will never see this object) and try again. This time the button won’t print a string (correct), but the ledge which it is over does not print a string either - the cursor hit test has been blocked by something in between.
It could be this is intended behaviour, but I don’t think so given the tooltip. Either way, please let me know, and if anyone can think of a way to be able to click actors underneath 3D widgets, I would appreciate the help!