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

How can I fix this script to open the door smoothly?

Basically, I want a door that opens to the side smoothly, but this just teleports it. How would I make it actually move?

local door = script.Parent
local click = script.Parent.ClickDetector

click.MouseClick:Connect(function()
	door.CFrame = door.CFrame + Vector3.new(-5.605,0,0)
end)

That's the script.

2 answers

The two most common ways of doing that is using tweenservice or lerp

lerp example

local door = script.Parent
local click = script.Parent.ClickDetector

click.MouseClick:Connect(function()
	for i = 0, 1 , 0.05 do
    		door.CFrame = door.CFrame:lerp(door.CFrame + Vector3.new(-5.605,0,0), i)
	end
end)

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