Widget Interaction Component in screen space

Hi,

I’m trying to create button where you aim at it to press it (no mouse cursor, but you should be able to click to press the button).

Basically I have an NPC with a widget component attached to it, and a widget interaction component attached to my player character. When I setup the widget in world space everything works correctly. But as I don’t want it to create shadows or be occluded, I want it in screen space but the widget interaction component on my character doesn’t seem to work anymore (no hover reactions and can’t click on the buttons).

Example of what I’m trying to achieve: UI_ref.mov - Google Drive

1 Like

Perhaps this helps

Thanks , but it only works in world space for me.

In my understanding this should not work. The interaction component traces against the quad geometry generated by the widget component’s world space setting. Afaik, this quad is not there while we’re in screen space.

But as I don’t want it to create shadows or be occluded,

Both can be disabled. The only downside is that 3d widgets are nowhere nearly as crisp.

Occlusion:

Shadows:

Widget Components do not cast shadows?

3 Likes

Thank you for your help, in my case they have shadows (following image).

It would be better to have them in screen space anyway. Do you have an idea how to reproduce the behavior of the widget component interaction in screen space? I thought about a virtual mouse but it doesn’t seem to be a good solution in UE.

Edit: With the solution you gave me, widgets don’t have shadows and are not occluded anymore.

Edit 2: And you’re right, it’s very blurry in world space. I can’t have a clear text, it’s always blurry.

image

SOLVED for me at least but this is a dummy solution I think.

For the occlusion I followed Everynone solution :

And for the text being blurry :

  • Increase the widget component draw size 2
  • Decrease the widget component scale by 2
1 Like

Are you still getting consistent hit results with this?


Also, if your widget is transparent:

May or not may not help. Depends on the scene setup.

Yes the hit results are still consistents. I’m just wondering about performance with this but that’s another question.

1 Like

You’re going to have how many on the screen at a time? Fewer than 10? Negligible is what I’d describe the worst case scenario.

Okay nice, i just noticed that the solution to remove occlusion doesn’t remove reflection. Any ideas on that?

Widgets reflect. Or are reflected?

Widgets are reflected :
image

My knowledge here is limited.

Someone will hopefully correct me if I’m wrong but I don’t think you can disable reflections on per object basis; that’d be to due to the way PBR works and the whole deferred rendering pipeline.

You can use a post process volume or a camera to adjust intensity of the reflections. A value of 0 would disable them all, this can be adjusted dynamically - as soon as the widget pops up or goes away.


Consider posting a new question in the rendering section, perhaps someone more knowledgably can chip in.

1 Like

Thank you for your help!