Yes, I’ve seen your problem before with the trace not following your sword swing animation. The code actually only stops working when I ask the server to get the socket position. The client can do it just fine so your theory makes a lot of sense.
I am going to try your solution when I get home. I’ll update with the results!
I was having similar problems when I used sockets to get a sword position. Does your code work on the server but not the client? If that’s the case we likely had the same problem.
Essentially the server doesn’t bother to update the client skeletons when it isn’t relevant, like animation culling, so to it the socket is still in the default idle position when the client actor isn’t being rendered. What I ended up doing was I had a vector variable that I updated every frame on the client (run on client, get socket pos.), and passed that data to the server (run on server, serverMuzzlePos = clientMuzzlePos). Then whenever I wanted the muzzle position I referenced this variable instead of having the server getSocketPosition.
This may or may not be your problem, hope it helps
This doesn’t seem to work for me. It looks like it should though. Perhaps there is some way to manually tell the gun where it should be when the crouch button is pressed? I’ll keep trying different things and reply when I’ve found a solution.
When I hook up the event to Event Tick, I can see two versions. The correct version is the client’s perspective, the incorrect version is the server’s. Then upon doing a Print String for the XYZ coordinates, it seems that on the server, the gun isn’t following the animation like you suggested earlier. The server ONLY sees a static position that does not follow the animation.