Best way to teleport players to different locations with a portal

Hey :smiley:

I am relatively new to Unreal engine and Blueprint.
I currently have this portal that teleports a player to another location when they press a certain key, when players get close to it a UI appears and I want them to be able to change the teleport location to a different location when they press one of the UI buttons.


This is the function that’s supposed to change the teleport location of the portal when a player clicks one of the buttons button (I currently have the New Teleport Location hardcoded for each button)

In a single player setting this worked just fine but now that I changed the project to multiplayer this function doesn’t really do anything anymore.

I feel like I am missing something obvious here or maybe there is a better way to do this :smiley: so I hope someone might be able to help me, thanks in advance!

Hi there, Swallie

While in SP you can move pretty much whatever you want, in MP any controller can only interact with objects it has authority over. For more in-depth explanation you can read Actor Role and Remote Role in UE

For how you should fix that:

  1. Call an RPC from an owned actor - in your case that would be either the possessed character or the player controller.
  2. That call should call your “Change location function” which would be executed no the server.
  3. In order to get the result back to the observing clients you should rely on replication so all involved objects should be replicated.

Don’t be intimidated by the C++ code in there. RPCs are easily done in BP like this:

Hey dZh0

Thank you for the quick reply! After moving some code around and running the RPC on the possessed pawn I finally managed to get it to work, once again thank you!