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

Why does the CFrame animation teleport?

Asked by
xsodar 19
4 years ago
for i = 0.001, 0.1, 0.001 do
    game.Workspace.Door.CFrame = game.Workspace.Door.CFrame * CFrame.new(Vector3.new(0,0.1,0))
    wait() 
    end
    end

    wait(5)

    for i = 0.001, 0.1, 0.001 do
    game.Workspace.Door.CFrame = game.Workspace.Door.CFrame * CFrame.new(Vector3.new(0,-0.1,0))
    end

So everything works until the door should go back, it just teleports back to the first position without any animation. Does anyone know why this happens?

Thanks for the help, Xsodar

1 answer

Log in to vote
1
Answered by
Norbunny 555 Moderation Voter
4 years ago

I would suggest using Roblox's Tween service, it makes things easier and smooth!

Either way, you forgot to add wait() in your last for loop, so the door instantly moves back to the original position.

1
Oh it was so simple, thank you, just added wait() xsodar 19 — 4y
0
Happy to help! Norbunny 555 — 4y
Ad

Answer this question