Socket Location Incorrect When Server Isn't Looking

Hello! I am using two socket locations on the tip of a sword and at the base, and then using some simple math to find three more positions in between them. When you are attacking, every .05 seconds the vectors update to new positions along the sword, and a trace is drawn from the old position to the new one.

Everything works great except for when the server is not looking at the client. For some reason the socket position does not follow the animation in this case, but rather just stays in the default idle position. I think this is due to optimizations from the culling system, causing the game to not play animations for the server when it’s not looking at the mesh of the client attempting to play it, so for it the location is whatever it would be in the idle position.

I’m not sure what to do at this point, any ideas?

Here are two pictures to illustrate what I mean:

Server is looking: http://i.imgur.com/M0MBDfy.png

Server is not looking: http://i.imgur.com/hUZ5cTt.png

I think I was right with the animation culling system. Now that I am more familiar with networking replication I tried using “Run on Client” to get the socket location and pass that to the server, which seemed to work

I know this is old, but I am having the same issue. Any chance we could get a picture of the blueprint of how you set up the “Run on Client” it would be greatly appreciated.

Set “Mesh Component Update Flag” to “Always Tick Pose and Refresh Bones”

GetMesh()->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::AlwaysTickPoseAndRefreshBones;
1 Like

oh man if you where near me i will kiss your cheek . thanks a lot .

You saved my night. I had sockets not updating when my server was looking away. I set my attached weapon mesh and character mesh to this and it works flawlessly now. Thanks again.

1 Like

Sorry for disturbing you 6 years later but i have been trying to debug this from last 2 months (kinda ignored it for a few months as i was unable to do it at that time) and this post helped me solve it instantly :face_holding_back_tears::face_holding_back_tears::face_holding_back_tears::face_holding_back_tears::face_holding_back_tears:

I am sorry but just to avoid new people leaving their head scratching in 5.3 atleast(i dont know since when tho) you instead need to use
GetMesh()->VisibilityBasedAnimTickOption = EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;

the MeshComponentUpdateFlag is deprecated and will not let you package project

Also I used the code in character’s class so getmesh is the character not the weapon or whatever you’re trying to attach