for my third person camera I have a custom behavior. The pawn rotates with the camera as in a shooter and the camera is allowed to rotate at any speed, but the pawn is meant to lag behind (can only rotate as fast as humanly possible).
First off I obviously disabled the option “Orient Rotation to Movement” and enabled “Use Pawn Control Rotation” in my Character blueprint. This gave me a Pawn that didn’t rotate at all, which then I proceed to do by code using my custom behavior.
what I do looks like this:
// inside my Tick function: FRotator ControllerRot = GetControlRotation(); FRotator ActorRot = GetActorRotation(); ControllerRot.Roll = 0.0f; ControllerRot.Pitch = 0.0f; ControllerRot = FMath::RInterpTo(ActorRot, ControllerRot, DeltaTime, 8.0f); // temp hardcoded speed of 8 SetActorRotation(ControllerRot);
locally this works flawlessly. I rotate the camera, and my Pawn rotates slower and eventually catches up.
in Multiplayer the (listen) server player can do it and clients see it properly.
however when a client does it, neither the server nor other clients see it properly. The result is that the rotation flickers between the new rotation and the default pawn’s rotation or some other wrong value. but I thought Actor Rotation is replicated automatically?
I also tried it with Blueprints btw, and the result was the same.
Additionally I tried making a new Replicated variable that sends the Yaw of the character every Tick to all the other players, but it seems even that is getting overriden by the replicated actor rotation (so the behavior is still wrong)