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

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

Asked by
Troidit 253 Moderation Voter
7 years ago
Edited 7 years ago

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
0
I dont see the problem as you are using fixed values. User#5423 17 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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

try mathStart = mathSpinRate instead.

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. Troidit 253 — 7y
Ad

Answer this question