How to click through UI to interact with actors in the world

Hi I’m creating some software but hit a bump where I need to be able to toggle interactions with actors in my world while I’m simultaneously interacting with my UI buttons.

Basically when access my UI by pressing a key using widget override, this makes my mouse cursor visible and sets me to input mode UI only

During this I lose control of my player controller while I click buttons to activate tools or other things. Once I leave this mode I hide my mouse cursor and gain full control back of my player controller by setting input mode to Game Only

Fairly simple, but while I’m in UI mode, I would also like to be able to mouse click on an actor in the world to toggle a feature on or off.

Is this possible?

Yep. There is a Set Input mode Game and UI which will hopefully do what you want:

1 Like

Kind of, but I’ve decided to use this type instead going forward to simplify these interactions.

I’m using Get Hit Result Under Cursor By Channel which bypasses the need for a line trace from camera position and lets my directly interact with any actor under my mouse cursor.

NOTE: There is a funny interaction with this however. If your mesh is single sided, regardless of what collision mesh you’re using, it will not interact if you’re trying to click it on the negative (invisible) side. It will only interact with facing normals.

HOWEVER this also mean that even if you’re using a camera facing shader to force the mesh to always face your camera facing position, it will still not interact correctly as it still uses the static meshes default status before shader manipulation.

This is important to know if you’re using planes to represent anything clickable.