Pitch and Yaw replication?

Hello

I can’t get pitch and yaw to replicate in multiplayer…

I’m building a third person game and my character got a Aim offset like the Owen sample.

Found this topic, but I’m not sure how to setup the animation blueprint:

Here is my blueprint:

Can anyone help me getting pitch and yaw working in multiplayer?

And here is my Animation blueprint,which is just a copy of Owen from the samples:

The red box is the script from the topic above… How do I setup this animation blueprint?

No body can help with this?

In unreal right now they only replicate pitch for client in Pawn, and you can only get that through C++ only. They replicate by taking value from Controller rotation from server, because only server and owner client have controller, which indicate where you look.
So here you need to get controller rotation, then get pitch and yaw from there and save to some replicate value for client to see.

Btw, must be weekend so no one there to answer.

1 Like

I have saved pitch and yaw in a variable like you said.
But how I can now use this Variables in AnimBP?
I have tried to send a InterfaceMessage with Pitch and Yaw. (didn’t work)
And I Have tried to make this Variable public, but I dont know which Target I have to set.

I have similar AnimBP like Xenosis

ziv eeevgkgggggggggggggvvgvug

One way i managed to update rotation also in multiplayer

2 Likes

This works in C++ without doing any extra replication. I only have the C++ code but I’m pretty sure everything is exposed in blueprint. This is used in the Shootergame C++ example for the first person aim offsets to replicate. Control rotation does not replicate but view direction is available for a pawn so you work backwards.

const FVector  AimDirWS = Character->GetBaseAimRotation().Vector();
const FVector  AimDirLS = Character->ActorToWorld().InverseTransformVectorNoScale( AimDirWS );
const FRotator AimRotLS = AimDirLS.Rotation();

Pitch = AimRotLS.Pitch;
Yaw   = AimRotLS.Yaw;
Roll  = AimRotLS.Roll;
5 Likes

Nice bro thank you so much

Oh thank you so much! No need to extra replication at all is needed thanks to Character->GetBaseAimRotation().

Super good to know this!

Hello, am 1 year from future, this is the way. still works in ue5.3

1 Like

@dancode @spacebares I understand this solution will work for replicating the pitch. Will this work in a third person game for replicating the yaw if your character class has bUseControllerRotationYaw set to false?

I have a third person perspective game, with bUseControllerRotationYaw set to false, and I need to replicate the controller aim yaw value so that way it can rotate the head left and right, but have been unable to find a way without adding my own custom yaw replication code.

Does someone know of a solution for this? Should the above code work for this?

Hi, I have the same problem, did you find a solution?