Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I rotate the player without screwing up movement?

Asked by 5 years ago
Edited 5 years ago

I've got a method that rotates the player, and it rotates the player just fine, but for some reason, it prevents the player from moving properly and causes extreme jittering when movement is attempted.

function module.RotatePlayer(player, rotation)
    local rotatedCFrame = player:GetPrimaryPartCFrame() * CFrame.Angles(math.rad(rotation.x), math.rad(rotation.y), math.rad(rotation.z));
    player:SetPrimaryPartCFrame(rotatedCFrame);
end 

1 answer

Log in to vote
-1
Answered by
Kullaske 111
5 years ago

I believe the issue is that the server is setting the rotation for the client. If you were to put this into a local script it should fix the jittering issue.

0
I thought client scripts were just for stuff that you wanted to happen to one player instead of all of them? Wouln't I want the player to rotate on everyone's screens? bludud1234 40 — 5y
0
It works, thanks bludud1234 40 — 5y
Ad

Answer this question