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

Extremely simple part rotation script isnt working?

Asked by 6 years ago
Edited 6 years ago

I have basically a ceiling fan type object, and this is a simple question so ill get to the point.

I want it to rotate like a normal ceiling fan but its not rotating nor does it error.

So basically it doesnt do anything.

Heres the code

local Fan = script.Parent
local SpinNoMore = false
local Rotation = 0

repeat
    for i = 0, 360, 1 do
        Fan.Orientation = Vector3.new(0, Rotation, 0)
        Rotation = Rotation + 1
    end
until SpinNoMore == true

P.S - I tried using body angular force, but the problem with that is a player can touch the fan and knock it out of place. I dont know how id lock it in the position because when I anchor it, it doesnt spin anymore.

Thank you for your time and Merry Christmas!

0
You dont need to have a Rotation variable, just use i NexanianStudios 91 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I have two explanations for you,

ONE: Try using Body Angular Velocity Instead Of Rotation, Unless You Wanted An Fan That Moves Without Constrains. Also B.A.V(Body Angular Velocity) Moves No Matter What so you would not have to repeat it. Roblox Wiki BAV: http://wiki.roblox.com/index.php?title=API:Class/BodyAngularVelocity Just Copy And Paste If The Link Is Unclickable

TWO: Try Using An Small Constraint (Rope) To Hook It Up On The Ceiling. It must not be visible. Then, insert your script INTO the fan.

NOTE NEVER TRY THE SECOND ONE WITH A BALLJOINT IT... Kinda Broke My ROBLOX Studio

Ad

Answer this question