Pawn replication issue

Use node: Cast to pawn > get controlled > cast to controller bp ////// dont forget to set your current controller bp from gamemode on root component of pawn.

Hi;

I have some problems with a Pawn and a FloattingPawnMovementComponent.
I can not retrieve the location of the pawn on the side of the server.

My pawn is configured as follows: Replicate Movement, Net Load on client, Replicate checked.

However, it is not visible to other pawn, and when in a custom event running on the server I use GetPlayerController>GetControlledPawn>GetActorLocation it’s always Zero.
I have add IsValid between GetControlledPawn and GetActorLocation for testing purpose, that does not give me any error.

The conclusion is that my Pawn is obviously not replicated, but it seems to be present side server.

However, why is not he replicated since he is configured for this?
I can not understand the inner workings of the pawn and the MovementComponent, nor why the server seems to completely ignore the parameters …

Cordially…

Hi BigBadWouf,

Assuming that the base class of your pawn is APawn then what you have is the expected behaviour because movement replication is not a default feature of this class. So you would have to do the replication by yourself by :

  1. Sending all the clients inputs to the server with RPC calls.
  2. Multicasting the inputs to the other clients.

(for more info you can read this thread)

While this would work, you should rather use the ACharacter class with its CharacterMovement Component that takes care of the movement replication automatically.

Hope it helps.