UMG following character

Hello! I have a little problem right now.

I did a widget that every player in screen spawn, attach him and show his name. That was the easy part (now, hehe. don’t ask me about 1 week ago :3).

Well, now I am trying that those widget follow their respective spawn.

I did this in the widget created:

But it always keep in middle. For now I am stuck.

Pd: I tryed too “Project World Location to Widget Position”, but I guess it isn’t the answer neither.

I saw in a “answer” (lost the website ><), where they recommend a 3D widget, but in this case I guess it will not work (Or can’t imagine how) because my widget is dinamic (name is choosen by player).

Thanks ^^

Use 3d widget and attach it to your pawn. In the widget blueprint create a bind to a string for the name of the player.

Thanks for the help!, but i must admit I still need more :frowning:

I created the widget and attached it to my Player1 Blueprint (a 3d widget). The problem is that I can’t get the reference to my widget

Btw, didn’t understood what is the use for the binding. It can’t have a input parametres, only a return.

Thanks for your help

Edit: I checked what binding does. Look like an “automatic” update of the value. That sound good, but I have more than 1 player, so I need use that widget in others players blueprint.

I can give a string that have the name to show (saved in the pawn created), but can’t reference it to the widget.

Edit2: Other problem that didn’t notice it before, the widget rotate with the player. I have the same camera for every player in game. I should rotate it in every tick in the correct direction, but again can’t get a correct reference for a “set rotation”.

Edit3: Rotation fixed, more or less. I used “space” -> Screen. Now it not rotate, but move with camera instead player (what I mean, if player 2 move, player 1 name move a bit too).

hmm… when i tried to do something like this, i added textbox to character’s 3d widget and binded displaying text to a function in widget itself, linked to character BP, to take variable to display directly from it.

to make link to character work, i added simple cast to character in widget’s event graph

this way is quite simple, and it leads to making individual widget for each character, but maybe general way can take you to a desired path

what concerns rotation, i used this manual as basis 3D Health Bar Part Two (Rotation) - YouTube and modified it with binding widget to camera direction. sorry, don’t have this BP saved, deleted as don’t need it in 2d game

Thanks for the help Varadori.

About those videos, can’t belive that I missed those tutorials! I had 2 problems:

The first one is that I thought that I didn’t need a “cast to my widget” bp because the “3d widget” already was pointing it in the details (but look that it is only for show). So I musted use it before call the fuction in my widget.

The second one is that I didn’t know the “get user widget object” that link my “3d widget” and the “cast to”.

Ill fix it when back to home later, at work atm.

Thanks so much.