Player limbs are rotated locally, but not noticed by other players

So I’ve made a gun script with a LocalScript within the StarterPlayerScript. When the player equips a pistol, the script executes a coroutine with a loop that rotates the player’s arms, head and torso up and down towards the mouse’s position. However, other player’s can’t see It. The way I did It is by changing the player’s Motor6D for each limb, just like this:

rightShoulder.C0 = defaultRotation[“RightShoulder”] * CFrame.Angles(angle*0.7,0,0)

I though about using RemoteEvents as a solution. For each loop, the player could send a petition to everyone to modify the local version of the player in each client. But I think It’s bad to over saturate the server with Events. I could reduce the amount of petitions (for example, one for every 10 ticks), but the result could look a bit choppy.

What do you think It is the best solution?

2 Likes

Definitely good stuff to be thinking about.

The way I usually do spammy events is by having the client only send significant changes, at a max interval. So for a body-tracking system, keep track of the last update you sent and don’t send another update until you’re > 5 degrees off of that, for example.

Each client should smoothly rotate other players arms to the last position they’ve received for that player.

1 Like

Thanks.

Well, It was hard, but I fixed It by using RemoteEvents. Instead of applying a change when the degrees difference is bigger, I rewrote the localScript in a way that It fires RemoteEvents every 0.2 seconds with the angle info. When other clients receive that request, the player will rotate smoothly during 0.2 seconds to that angle.

2 Likes