You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
I want to be able to replicate position and orientation of player arms 60 times per second so that arm movement looks smooth to other players.
What is the issue?
Roblox seems to have an internal script that automatically sends each player’s position to the server roughly 60 times per second. When I see other players move, it looks super smooth. For my code, I have a remote event with the current angle of the player’s arms relative to the ground as a parameter, and I fire this remote event inside renderstepped so that it fires roughly 60 times per second. Next, I have the server fire another event to every single player except the player firing the event so that all the other players can get the angle of the player’s arms who sent the original event. The problem is that the server receives the event properly but only transmits the next event at a rate of roughly 20 times per second. This makes arm movement replication look very stuttery. Is there a special method I can use to handle rapid fire remote events the way that roblox’s internal script replicates player positions?
What solutions have you tried so far?
I tried sending the angle of a player’s arms through a remote event inside renderstepped, but remote events appear to have a send rate capped at 20 remotes events per second.
How does roblox automatically replicate player positions 60 times per second, though? Player movement looks super smooth by default, but when I try to replicate arm movement, it looks super laggy.
How would that work? If a player moves 50 studs forward, you’d need an animation for walking forward 50 studs. What if the player turns while walking? There’s no way this can be done with an animation. You’d need an animation for every possible distance a player can move or turn. They’d have to use CFrames to move the player, but they would also have to update the player’s position on the server by sending an event every 60th of a second to keep it looking smooth. At least, that’s how I think it works.
I’m not talking about walking animations though, I’m talking about replicating a player’s position to the server and having the server send that position to all other clients so that they can see the player move.
I believe updates on physics objects (including characters) do not replicate at 60 Fps. They replicate at a lower refresh rate but are interpolated on your screen to look smooth.
Please don’t try to replicate things at 60 FPS. It will tank network performance
Yessss! I suspected that there was a built-in way to do things like this! I bet that’s how roblox’s internal script does it too! They must set the network owner of a player’s HumanoidRootPart to it’s own player. Ok, I’m going to modify my script and see if arm movement replicates to the server properly when I set the network owner of the arms to my player.
The network-ownership will work, but its not really used for what you are doing. If you are using for this all players then the lag would be outstandingly bad. Good luck with this though!
I’m making a first person shooter, and I make the arms follow the mouse when a player moves the mouse around. The arms don’t move on the server, so other players can’t see when I move my arms, and I can’t see when they move theirs. I just want to make it so other players can see what I see by somehow sending my arm positions 60 times per second so that movement looks as smooth to other players as it does on my screen.
Make sure you unanchor the part on the server. You can’t really set network owner when the basepart isn’t moving.
Also, try to remember that the client will have full control over the part or parts that you give it access to. Keep this in mind as exploiters might use this to their advantage.