First of all, the block I'm rotating has a mesh in it. But the following code breaks when it gets to the rotation 90 on the Y axis
local b = script.Parent while true do wait(.01) b.Rotation = b.Rotation + Vector3.new(0, 1, 0) end
Its probably better to use CFrame and while wait(.01) do here is the overall result of the script.
local b = script.Parent local rot = 0 -- Make a rotation variable while wait(.01) do rot = rot + .01 -- Make it add on every .01 second b.CFrame = CFrame.new(b.CFrame.X,b.CFrame.Y,b.CFrame.Z) * CFrame.Angles(0,rot --[[set this to rot so it can rotate]] ,0) end --There you go!
Hope this helps!
The reason why it doesn't work is because you are adding +1 to the rotation each time.
On Roblox, when rotating a part, once the Y rotation gets to 85, it looks like this:
--This is what the rotation looks like if you add 1 to the Y value each time 0,85, 0 0,86,0 0,87,0 0,88,0 0,89,0 0,90,0 -180,89,-180 -180,88,-180 -180,87,-180 -180,86,-180 -180,85,-180
I don't know how to entirely explain this, but I'll fix your code.
local b = script.Parent while true do wait(.01) b.CFrame = b.CFrame * CFrame.fromEulerAnglesXYZ(0,1,0) end