How to set world widget face to camera (multiplayer)

Hi guys,

I make a multiplayer game and want to make the player be able (or not) to see the other Name and health bar.

Actually it work for one player on the session and don’t know why not for the others :frowning:

Maybe it’s cause I’m on editor window and not on packaged client ?

Anyway, I want to know your opinion about that :

Here my blueprint and how I make it face to the camera’s pawn :
https://www.mediafire.com/convkey/2f3d/o92g9doq7n34bkg6g.jpg

This is what you get in game :
https://www.mediafire.com/convkey/f847/d45o4h82vrp6wep6g.jpg
Like I said, it follow the camera but for only one component (Nameplates)

And this is the issues list, but I think it’s only the tick event that make these errors

I hope it’s clear enough ^^

Ok, forget that ! I found a way !

I have to make the “Nameplates” rendering directly on the pawn and not as a widget but as a component. So I can easaly set it to face to camera !

It work for names, now I’m going to make it for health bar and stuff like that :wink:

You have to make sure that under “user interface” of the widget component “space” is set to “screen”. This way it will be treated as a 2d widget appearing on your viewport at the designated location inside the actor.

I already know that but I need to be in world, if I put it on screen I will have the problem where it’s not occulted and the player can see if another player is “hidding” behind a Mesh/wall is world.

It’s why I put in the thread that I need a “World” widget

Then you have to manually set the rotation of the widget by rotating the forward vector of the widget to the directional vector calculated between the player’s name widget and the camera of the player looking at it.

Yes is already ok like I put on the screenshots, my problem is that it work for one player but not for the others. If I play with one server and only client all is working well. But when I got 4 players all go wrong

You have to make sure that every instance of the character sets the rotation based on the actual controlled pawn’s camera, not on it’s own camera.

What you can do is use “is locally controlled” node to save the camera location in a vector that you then replicate. Then on tick (not after locally controlled) you update the rotation with the replicated vector. This should rotate the name tag always towards the clien’ts controlled pawn camera.

Hum… I’m going to try that ! Seems to be clean ! I don’t know if I can do that by myslef but let’s try ^^

Ok, I understand now but no, it’s not my problem -_- I’m lost…

My problem is that only one widget added follow the camera. And it work like this for all. Client or server it’s the same. Each one got only one widget following the camera that you own. replication seems to be set as well cause I got the color for all of them and I can see the names even I change in the lobby.

What’s happen here -_-

I can’t compile the project right now to try that with Game and not with editor window ! my bad…

Here is the solution
How To Make Auto-Rotate Health Bars and Player Names in Unreal Engine Beginner’s Tutorial (youtube.com)