Simple tween script not working?

Hi there, I am currently struggling with a really simple door system tweening the door objects (which won’t work!)

I don’t know why it would not work, because it prints the stuff which I put right above the tween line into the output, yet the doors won’t move. There is a BindableEvent getting fired when the train comes to a stop automatically. My goal is to tween the position to another part giving the position of where the door should be when open, and either way. The door is a simple union.

No errors were printed

Code :

function open()
	print ("Open Door")
	local tween = TweenService:Create(script.Parent.Door, info,{Position = script.Parent.DoorOpen.Position})
	tween:Play()
end

function close()
	print ("Close Door")
	local tween = TweenService:Create(script.Parent.Door, info,{Position = script.Parent.DoorClosed.Position})
	tween:Play()
end

Drive.FireDoors.Event:Connect(function(cmd)
	if cmd == ("Open") then
		open()
	elseif cmd == ("Close") then
		close()
	end
end)

Did you test it in studio? If so try and test it in the server itself.
because I got errors usually when playing in the server rather than in the studio

If that script.Parent.Door is a Model, then that could be the reason for it not working.

Also your code does not specify what the info contain - I suppose you have a info = TweenInfo.new(...) somewhere?

Take a good read through this post, as it will introduce you to some details using the `TweenService´:

Update

Apparently it was because the part was not anchored, anchoring it fixed it.

5 Likes