Hey everyone,
I’m making an animated door for my story game, however it is not working. Here is my script:
TweenService = game:GetService('TweenService')
Door = game.Workspace.door
ClosePlaceHolder = Door.DoorOpen
OpenPlaceHolder = Door.DoorClosed
function OpenDoor()
local info = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local openProperties = {CFrame = OpenPlaceHolder.CFrame}
local OpenTween = TweenService:Create(ClosePlaceHolder, info, openProperties)
OpenTween:Play()
end
OpenDoor()
Here is the part layout:

There are no errors, nothing happens.
Thanks for any help 
2 Likes
I’m not sure if it’s anything to do with it being unions or not.
Alright! I’ll walk you through the easiest method!
local properties = {}
properties.CFrame = OpenPlaceHolder.CFrame
local openTween = TweenService:Create(ClosePlaceHolder, info, properties)
openTween:Play()
If this doesn’t work, let me know.
It didn’t work. Is the door supposed to be anchored?
Yes. It is. I also wrote up a script in the meantime.
local cd = script.Parent.ClickDetector
local ts = game:GetService("TweenService")
cd.MouseClick:Connect(function()
local final = {}
final.CFrame = workspace.Final.CFrame
local tweenInfo = TweenInfo.new(5)
local tween = ts:Create(script.Parent, tweenInfo, final)
tween:Play()
end)
I added this script into a part but nothing happens; the door doesn’t open.
local cd = script.Parent.Part1.ClickDetector
local ts = game:GetService("TweenService")
cd.MouseClick:Connect(function()
local final = {}
final.CFrame = script.Parent.DoorOpen.CFrame
local tweenInfo = TweenInfo.new(5)
local tween = ts:Create(script.Parent.DoorOpen, tweenInfo, final)
tween:Play()
end)
Could It have something to do with the part I’m tweening being anchored or a union?
No, I have tried it both. It all seems to work, it must be an issue with your tween properties.
Nevermind, you have my properties.
I’ll send you the place file, hold on.
tweenServiceHelp.rbxl (22.5 KB)
Here you go.
1 Like
What type of script is this, and where is the script? This might have to do with placement of the script.
It’s a normal server script and here is the layout:

I don’t see any script there. Where is the script?
The script is:
TweenService = game:GetService('TweenService')
Door = game.Workspace.door
ClosePlaceHolder = Door.DoorOpen
OpenPlaceHolder = Door.DoorClosed
function OpenDoor()
local info = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local openProperties = {CFrame = OpenPlaceHolder.CFrame}
local OpenTween = TweenService:Create(ClosePlaceHolder, info, openProperties)
OpenTween:Play()
end
OpenDoor()
And it’s in ServerScriptService.
Can you try printing stuff in the script to mark places where it works?