I previously made the same topic and it worked for a while. Now it stopped working again.
I know it is an issue with Roblox trying to normalize Rotation
, but I don’t know how to fix it or work around it.
My script:
-- // Settings \\ --
local speed = 5
-- // Code \\ --
local RunService = game:GetService("RunService")
local part = script.Parent
RunService.Stepped:Connect(function(t, dt)
local rotation = part.Rotation
local newCFrame = CFrame.new(part.Position)
part:PivotTo(newCFrame *
CFrame.fromAxisAngle(Vector3.yAxis, math.rad(rotation.Y + speed))
)
end)