Tweening problems with CFrame

I want to make a door that can open and close

The issue is that the tween doesn’t happen.

Ive looked to forums and other websites, i haven’t found any solutions. Ive tried unanchoring it and changing CFrame to Position.

(server script)

pp = script.Parent
door = pp.Parent
target = door.target
origin = door.origin
TS = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(
	0.5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)
local dooropen = false

pp.Triggered:Connect(function()
	print("activated")
	if dooropen == false then
		print("opening")
		TS:Create(door, tweeninfo, {["CFrame"] = target.CFrame})
		dooropen = true
		return
	end
	
	if dooropen == true then
		print("closing")
		TS:Create(door, tweeninfo, {["CFrame"] = origin.CFrame})
		dooropen = false
		return
	end
end)

Thank you to anyone who helps

dont worry we all make this mistake but you forgot :Play for the tween

1 Like

whoops :sweat_smile:, not my first time doing this, sorry

i did it yesterday lol

30 letters