Animation replication : head orientation

Hi everyone !

Today I’m trying to make the head of my mesh moving, depending on where the player is looking at. In other words, as my game is first person, if the player move his mouse, I want the head of his mesh to follow and look at the same direction. I want it to replicate so every player connected in my dedicated server can see other players head’s moving.

Everything work in local, thanks to the following blueprint in my animation blueprint.

My “GetHead” function is linked to my “Event Blueprint Update Animation”, so at every frames, I get the rotation of my “VrCamera”, defined in my Pawn, and set it into a rotator called “PreHeadRotation”, which is linked to a Transform (Modify) Bone (Head) in my AnimGraph.

Troubles begin when I try to replicate it on my dedicated server.

Here’s my Pawn Blueprint. I created a “HeadRotationPawn” rotator which is replicated.
The first function, “GetHeadRotation”, is triggered in my Animation Blueprint, at the end of the first picture (ie in “Event Blueprint Update Animation”).
The 2nd one is “Run on owning client”, and I get the rotator “PreHeadRotator” saved in my Animation Blueprint to send it to the server.
The last one is Run on server", and I set my replicated variable with “PreHeadRotator” value.

In my Animation Blueprint, I watch the value of this replicated variable and set it into a new rotator “HeadRotation”, which used in my AnimGraph.

I’ve followed many tutorials, and manage to make replication works to change some materials for every clients, but I can’t manage to make it works with the animation blueprint. My issue comes from the replication, because in local, before I connect to the dedicated server, my head is moving, even with this blueprint. But when I login and connect to the server, it stops working, even for myself. So I think my server is unable to retrieve or to send my variables from/to clients.

Maybe my issue comes from the fact that my “PreHeadRotation” and “GetHeadRotation” and defined/triggered in my animation blueprint, and I can’t manage to make it works.

Any help would be appreciated ! Thanks for everyone who read :).

Ok it was my bad. I was playing in editor, but when I packaged the project and retried, everything worked.
In the end, the blueprints I provided work. Feel free to ask me questions if you are interested about it.

Hi I’m having trouble replicating this for my game although its a listen server not dedicated, using this setup the server and client can move their heads but the rotation won’t replicate on either side