Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Rotating an object that over time starts speeding up? [Solved]

I'm scripting a fan that lets the fan blades rotate around repeatedly at a specified pace. My problem is that the fan blades start to speed up over time.

blades = script.Parent:GetChildren()
spinSpeed = 0.005
mathStart = 0 --angle start?
mathSpinRate = 0.005

while true do
	for _,v in pairs(blades) do
		if v.Name == "Union" then
				v.CFrame = v.CFrame * CFrame.Angles(0,math.rad(mathSpinRate),0)
				mathStart = mathStart+mathSpinRate
		end
	end
	wait(spinSpeed)
end

1 comment

0

I dont see the problem as you are using fixed values.

1 answer

on line number 10 you have mathStart = mathStart + mathSpinRate which then starts to stack the value upon itself.

try mathStart = mathSpinRate instead.

1 comment

0

That didn't fix it, but I definitely see what you were going at. After reviewing that small part, I noticed something in line 9 and I was able to fix it.

This discussion is preserved as it was. New answers, comments, and votes are closed.