I’m trying to rotate a part using CFrame, however, it never rotates correctly. I’m trying to make it turn 10 degrees on the Y axis, but it always ends up at a random Y orientation. All help is appreciated.
game.ReplicatedStorage["079Move"].OnServerEvent:Connect(function(plr, action)
if action == "TurnLeft" then
game.Workspace["079Camera"].RotateBall.CFrame = game.Workspace["079Camera"].RotateBall.CFrame * CFrame.Angles(0, ((game.Workspace["079Camera"].RotateBall.Orientation.Y) + 10), 0)
end
if action == "TurnRight" then
game.Workspace["079Camera"].RotateBall.CFrame = game.Workspace["079Camera"].RotateBall.CFrame * CFrame.Angles(0, ((game.Workspace["079Camera"].RotateBall.Orientation.Y) - 10), 0)
end
end)
game.ReplicatedStorage["079Move"].OnServerEvent:Connect(function(plr, action)
if action == "TurnLeft" then
game.Workspace["079Camera"].RotateBall.CFrame = game.Workspace["079Camera"].RotateBall.CFrame * CFrame.Angles(0, math.rad(-10), 0)
end
if action == "TurnRight" then
game.Workspace["079Camera"].RotateBall.CFrame = game.Workspace["079Camera"].RotateBall.CFrame * CFrame.Angles(0, math.rad(10), 0)
end
end)