Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does the CFrame animation teleport?

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

✓ Accepted answer

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.

2 comments

1

Oh it was so simple, thank you, just added wait()

0

Happy to help!

This discussion is preserved as it was. New answers, comments, and votes are closed.