Multicast problem, how to get refence to the client the function is running on?

When a player joins the dedicated server his client sends out a multicast function to everyone that says the player has joined. However, this text needs to show on each players TextRender component. But instead of this happening all players do get the message but it shows up on the player pawn that called the multicast function, as in I see the new player running past me with text in front of their face that says “Player whoever has joined the game” haha. Clearly that’s a problem. Hope that’s clear, how can I fix this?

The Server should multicast the message to the clients, after the client is allowed to join. Not the Client.

Yes, the client calls a server function that then calls the multicast. The multicast function does work. But instead of sending the message to each persons textrender component, it sends it to the textrender component of the person that joined the game. As in I can see the other players textRender, but I shound it on my own. Does that make sense? I feel I might need to get a screen capture to explain it…

A screenshot always helps with BP issues, a video is even better. haha. I belive your solution is in this video.

I figured it out after finding this thread, linked below. It turns out that you need to use one of the get functions that references a player index, such as GetPlayerController with index 0 which will always return the local player. Not sure why “self” reference isn’t a self reference in a multicast, but instead self points to the client BP that called the server function that calls the multicast function. So basically I just used GetPlayerController then GetControlledPawn and casted to the pawn type from there I set that as the target of the TextRender. It works, but it calls it twice for some odd reason, but was easy enough to avoid the unwanted call by checking if the player name is null or not.

Link to thread