On both clients (left), the behaviour is normal, and they face each other correctly.
But on the server, the characters do all sorts of crazy things.
The code responsible for doing this is inside a RenderStepped loop, and it rotates the player to face the opponent:
-- Inside a LocalScript
char.HumanoidRootPart.CFrame = CFrame.lookAt(char.HumanoidRootPart.Position ,targetPos, Vector3.yAxis)
Removing this line fixes the problem, which is a decent hint to what causes this issue. Is there a better way to do this though? Because my serverside code is experiencing Heisenberg’s uncertainty principle when trying to find the position of the player
-- Inside a localScript
-- opp is the opponent's character
local targetPos = Vector3.new(opp.HumanoidRootPart.Position.X, char.HumanoidRootPart.Position.Y, opp.HumanoidRootPart.Position.Z)
char.HumanoidRootPart.CFrame = CFrame.lookAt(char.HumanoidRootPart.Position ,targetPos, Vector3.yAxis)
Small update: The behavior is normal on other player’s screens too (Those who do not have the lookat code apply to them). This is (for some reason) a serveride issue only