Hello. I’ve been trying to replicate the player (its pawn) after attempting to teleport him in a particular place on the level, but it fails. Neither works with “SetActorLocation”
I’m trying to do this through a Widget BP.
Accessing a function with a replicating (Multicast/OnServer) custom event from the Player BP doesnt do the thing; neither does creating a replicating custom event in the Widget BP itself and referencing to the “owning pawn”.
This is what I meant: https://i.imgur.com/VCDKCa8.png
On Player BP: https://i.imgur.com/lPg1Aev.png
With both methods it works offline/Standalone, but when i try to do this online/As Client, it won’t work :(. The pawn doesn’t have authority.
What should I do to allow the pawn to have authority to teleport and replicate this on the server?
User “LeafBranchGames” from reddit helped me out greatly!
Event int func teleport needs to be
set to replication method “run on
The widget one will never work.
So to explain this; a multicast is an
event that must be run on a server to
work. Only server is allowed to do a
multicast. That is why the widget one
fails, because widgets only exist on
So to be sure the server is calling
the multicast, you need to have
controlled the flow to make sure that
happens. For example by having the
“int func teleport” event be “run on
server”. Because then when a client is
running its code, and get to the “int
func teleport” call, then it will send
it to the server to execute, it in
turn will then call a multicast which
in turn informs all clients about
whatever code is in the multicast.
I have a few multiplayer replication
tutorials if you want a more thorough
Tutorial: Multiplayer replication - Unreal Engine 4 + Unreal Engine 5 - YouTube
So yeah, the solution was calling it from the Player BP and use a custom event with “RunOnServer” not “Multicast”. Running from the Widget would’ve never worked.