Directly Manipulating Loc/Rot of Character in Multiplayer Match

Hi,

I am working with the first person template project, just trying to do something pretty basic with a pawn blueprint that inherits from Character, and the standard PlayerController. In a 2 player multiplayer match, I’d like to teleport a character to the world position and world rotation of the other player.

My CharacterMovement component is set in it’s defaults to use the controller yaw and pitch, so I am careful to be setting the Control Rotation on the player controller.


This works on the server side, but for the client instance of the game, when I attempt to teleport, it seems like the movement replication code in CharacterMovement does not like having the position or rotation of a client directly manipulated. For a single frame I can see the client in the spot I want, then the error correction code quickly moves the client actor back to where the server thinks it should be.

Is there a way to do this out of the box with the Character class in a blueprint? Or do I need to extend the C++ class to write a TeleportCharacter() function that will play nice with the replication system?

Thanks

CharacterMovementComponent is solely acceleration based, so I created a pawn that override AActor::TeleportTo() that instead of immediately teleporting the actor, sends a request to the server to teleport the actor and not do any position error correction for a frame.