Hey guys! So long story short; I followed a tutorial (Mostly) for a teleportation that works in online multiplayer just fine. The problem arises when I want to use a Gate node and Input so that the player only teleports (Through a door) when they are standing in it and pressing the ‘E’ key. The host can do it, but the clients can’t. I’m not sure what I need to be replicating at this point or how to fix this. I don’t want to entirely change up the method on how teleportation works or use the “teleportation” package from the marketplace (I bought it, too complicated for me to use between 2 different types of blueprints)
Here’s an image of my code
It works fine for both client and host if I don’t use the input (Player walks straight into it, appears at destination fine)
If anyone knows what I need to be doing, help would be appreciated. I’ll even go as far as to pay someone if they can make a tutorial sometime soon. Thank you!
you need to call teleport on the server,
what you need is a RPC (Remote Procedure Call) call from the client to the server on pressing E
meaning, an event set to run on server and Reliable
added fun is, as a client you can only call RPC on owned actors, in your case best probably on the player character,
meaning you will need to add the logic on your player character, which needs to get the data for teleportation
Hmm, the unfortunate bit is that by the looks of it; I’d have to copy this same line of code for every single teleporter on the level, creating a new event for them all. That’s not even including the possibility of having to do that logic in both character blueprints as well. Man, I really feel like it’d be possible to do this without needing that, you know?
So, how exactly would the logic for the player character’s end look like?
The teleporters should be their own teleporter actor and have a set teleport target logic in them.
Target Actor should be an Actor Soft Object Reference, which after placing you need to put to the target of this teleporter.
And on the player character you need to validate if you have a current teleporter target,
and then call the function on the server
[Example implementation in the TeleportationByInputFolder]
You need to set the target teleporter in the Actor Soft Object Reference per teleporter
there should not be a need to do anything in the level blueprint.
Man, i love you (no homo)… Worked flawlessly. Thank you so much brother