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

Is there an easier way to ease transitions/rotations of gui?

Asked by
Benbebop 1049 Moderation Voter
4 years ago

This is a script I came up with to make a gui object rotate 360° in 3rds and ease in and out each time.

local RotDirection = 5/60
local RotIncrease = 5/60
local AnimFrame = 0

while wait() do
    RotIncrease = RotIncrease+RotDirection
    script.Parent.Rotation = script.Parent.Rotation + RotIncrease
    if script.Parent.Rotation >= script.Value.Value+60 then
        RotDirection = (5/60)*(-1)
    end
    if script.Parent.Rotation >= script.Value.Value+120 then
        script.Value.Value = script.Value.Value+120
        RotDirection = 5/60
        RotIncrease = 5/60
    end
    if script.Value.Value >= 360 then
        script.Parent.Rotation = 0
        script.Value.Value = 0
    end
end

There must be a better way to ease a movement then manually calculating it, how can it be done?

0
Sorry I didn't give code, I'm terrible with the TweenService lol cmgtotalyawesome 1418 — 4y

Answer this question