Widget component in world space to face camera

I have a character with a widget component.
The widget is set to world space as I want this visible to all split screen players.
In the character view port I can see this just fine.
If I play the game, when I move the camera to the correct position I can see the widget, so I know it is working.

I have searched for some examples and the closest suggest using a material to orient the material to the camera.
One suggested using a material using in the Epic Stylized renderings pack, but this seems out of date and does not work.

A more simpler version uses AlighMeshToTheCamera in the material connected to the World Position Offset.

This works and I now see a ‘plane’ where my widget should be, it is sized correctly, however it is just bright wight.

I cannot figure out what I need to connect in the material to allow the colours and text and the widget to ‘come through’

1 Like

I’m not sure how to use your World Offset technique, but you could try using the Get Look at Rotation node in blueprints to get the widget to always “look at” the camera.

I’m assuming widget components can be used in blueprints just like any other component, and I would think the “front” of the widget would count as the part the player sees.

Thanks, I have seen this approach but wasn’t sure it would work in split screen.

Could two players be looking at a third at different angles, and both see the players name at the same time?

Thanks, I have seen this approach but wasn’t sure it would work in split screen.

Could two players be looking at a third at different angles, and both see the players name at the same time?

Ah, good point. I’m not sure if this would work on a split screen.

If it doesn’t work, I guess you could have more than one of the same widget on the character, and each widget could be assigned to a different split screen player’s camera…but that might be getting more complex than needed.

Yeah, I guess keep looking for a way to do it in the material editor then. :slight_smile: Good luck.

Thanks for your help.
I can see the material is approach should work. In split screen with 2 or more players all looking at the same character, the name ‘tag’ appears for each player as you would expect.

The difficulty I am having is have the actual widget context shown. One I apply the material to the widget, I get the camera behaviour I want, but the appearence of the widget, is purely that of the material, i.e the colour.

For anyone struggling with this, I found the default material applied to widget components Widget3DPassThrough, I then copied this into my project.
A quick simple edit to add the ‘AlighMeshToCamera’ function to the ‘World Position Offset’ and boom, problem solved!

11 Likes

Thanks, it works perfectly. Just connecting World Position Offset to material’s World Position offset and that’s it.

Definitely better to do this on the material that doing the calculation on CPU look at calculation.

3 Likes

If you want a world widget to always face the camera, you need to change the “Space” setting from “World” to “Screen”. Head to your blueprint containing the widget component then in the “User Interface” category, you should find the “Space” setting there.

1 Like