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 so I hope someone might be able to help me, thanks in advance!
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:
Call an RPC from an owned actor - in your case that would be either the possessed character or the player controller.
That call should call your âChange location functionâ which would be executed no the server.
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:
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!