Download

Aim offset replication, pitch is fine, yaw is not

sorry for yet another aim offset thread, i searched but couldn’t find anything that helped.

i spent the past 2 days searching up and down trying to find a solution but with no luck. I even purchased the generic shooter template in order to see another projects solution but it only solved half of the issue.

the aim offset is not replicating properly to all clients. only pitch is working, yaw is simply not. i would like this to work in dedicated and listen.

when in combat mode (low ready in my bp’s) the characters entire body rotates fine and looking up and down works flawless as well. when i go out of combat mode (low ready) the upper torso and head should rotate according to the direction in which the player is looking. it works fine for the owner but other clients can not see the animation and their turn is not being received either.

so i can see myself turn properly but i cant see other players turn. they cant see me turn but see themselves turn properly. i hope that makes sense.

here is the character bp eventgraph bp where yaw and pitch are set. both are replicated
http://blueprintue.com/blueprint/kdzhzch7/

here is my animbp blueprint
http://blueprintue.com/blueprint/t9ua90a9/

the pitch is pulled from the generic shooter template, but i couldnt find anything for yaw so i figured i would replicate it, get it in the animbp and then set it there.

i tried quite a bit but with no luck.

any help is appreciated

It is too less if you just enable the “replicated” flag of the yaw variable on a client. You have to set your replicated variable on the server. You could do that via a custom event and choose “Run on Server” on the Replicates pulldown (before you do what you do to feed your variable with some value). If you would create a listening server then you could split this up via a SwitchHasAuthority node. If it has authority then just set it without any custom event between else call the custom event function first that tells the server it should do the same.

you gotta be kidding me… you are a genius… i actually had it setup with a custom event, like you said, but the crucial mistake i made, i called it AFTER i set the value… literally the one thing i didn’t try was to place the event further forward and that solved the issue. thanks neutronux. i actually managed to cut down a bunch of nodes and made it cleaner now too.