how to show the name of the player in a message?

exemple (player name) win!

You can use UMG widgets to display this information. To learn more about them you can look here: UMG UI Designer User Guide | Unreal Engine 4.27 Documentation

The process is rather simple once you understand the core concept of how to work with UMG widgets:

  1. First, you need to create a new UMG widget by right-clicking in the content browser, selecting “User Interface” and then “Widget Blueprint”. Name the widget “PlayerMessageWidget” or something similar.
  2. In the new widget’s graph, add a Text Block widget to the canvas. This will be where the player’s name will be displayed.
  3. Now, you will need to get the player name, simply use a cast and a get variable function from where the name is stored.
  4. Save and close the widget blueprint, and go back to your main level blueprint.
  5. Add an event that will trigger the display of the player message. For example, if you want the message to appear when the player presses a button, you could add a “OnButtonClicked” event to the button.
1 Like
  1. Now, you will need to get the player name, simply use a cast and a get variable function from where the name is stored.

I’m not sure this is possible on UEFN.

As far as I’m aware, you can only display the player’s own name in a Hud Message Device by activating the device for that specific player and using {playername} in the message.

I totally missed the UEFN tag…

My answer is for the traditional Unreal Engine 5.

Hi @Wolf_RafaTLDS, Welcome to the forums!

I moved this to where it will get more eyes on it and removed the Unreal Engine tag.

1 Like