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

How to keep part from moving from its place?

Asked by 8 years ago

Alright so I am animating my part but when it is going down it stays in mid air, I tried to keep the position the same by making its position be 0 in y axis but it makes it function weird and not animate right.

function AnimatePart(part, up)
    local size = part.Size
    local pos = part.Position
    up = up or false
    if up then
        for alpha = 0, 1, 0.0625 do
            part.Size = size:Lerp(Vector3.new(10,20,10), alpha)
            part.Position = pos
            wait(.03)
        end
    else
        for alpha = 0, 1, 0.0625 do
            part.Size = size:Lerp(Vector3.new(10,1,10), alpha)
            wait(.03)
        end
    end
end

Answer this question