So, the way this works is that the Player’s Orientation get’s changed on the Client, then a remote get’s fired to the server containing the Player’s Orientation, and then on the server the remote get’s Fired to all Clients with the Orientation that the player has.
And, while it works pretty well, there’s Jittery movement (as you can see on the Right side of the screen)
If you are firing a remoteEvent every time the players orientation gets updated, it might timeout due to bandwidth issues, instead you should use a unreliableRemoteEvent which is mainly used for a large amount of remoteEvent’s firing without using a lot of bandwidth.
Instead of firing a lot of events to update the orientation of every player on the server, why not just use a loop over the players in a local script and set the orientation for each player in that way?
Here is a code snippet from a Directional Movement script as a reference.
RunService.RenderStepped:Connect(function(dt)
for _, Player in game.Players:GetPlayers() do
if Player.Character == nil then continue end
if table.find( PlayersTable, Player ) then continue end
table.insert(PlayersTable, Player)
end
for i, Player in pairs(PlayersTable) do
if Player == nil then
table.remove( PlayersTable, i )
continue
end
if game.Players:FindFirstChild(Player.Name) == nil then
table.remove( PlayersTable, i )
continue
end
if Player.Character == nil then
table.remove( PlayersTable, i )
continue
end
local HumanoidRootPart = Player.Character:FindFirstChild('HumanoidRootPart')
local Humanoid = Player.Character:FindFirstChild('Humanoid')
local Torso = Player.Character:FindFirstChild('Torso')
if HumanoidRootPart == nil or Humanoid == nil or Torso == nil then
continue
end
Calculate(dt, HumanoidRootPart, Humanoid, Torso)
end
end)
I’m probably too late but just in case anybody stumbles onto this, I have the solution for you. I was having the same problem and the solution is to disable the AutoRotate property of the character’s humanoid when you load the character.
Humanoid.AutoRotate = false
The player’s character is forced to face the direction of its movement which conflicts with your code when you try to set its rotation. The way to disable the default rotation thing is by setting this property to false.