Help with tweening a model

Hello. I am currently making a door. This is my first time tweening models instead of just a part. I want to door to move up and it takes two seconds to.
I have the models primary part set to a part called “hinge”. I then welded all the other parts to this part.
Here is my code:

	ts:Create(innerPrimary,, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0), 
		{CFrame =, 53.05, -517)}):Play()

The innerPrimary is the models primary part called hinge.
I set the to the position I want the door to go. When I run it, it does nothing but there are no errors. Can someone help?

1 Like

I’m pretty sure if it’s Welded to a part, it can’t change position and only orientation. You should separate the tween code and the actual tween playing, and add the script to the Hinge instead (if it’s not added to that). You can also try tweening the Origin Position.

Keep in mind I’m not a professional, it’s just what I think would work. If it doesn’t, I apologize very deeply.

To tween a part you can use the following!

local TpTest = script.Parent

local function move(model, wp)
	local TweenService = game:GetService("TweenService")
	local TweInfo =
	local cf ="CFrameValue")
	cf.Value = model:GetPrimaryPartCFrame()
	local tween = TweenService:Create(cf, TweInfo, { Value =})

move(TpTest, workspace.Wp) -- set "workspace.Wp" to where you want it to tween to obviously lol

Basic tweening except it uses models instead.

1 Like
	innerPrimary,, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0),
	{["CFrame"] =, 53.05, -517)}

This is caused because “CFrame” is both a class type (custom value type) and a property shared by many instances, so any reference to “CFrame” alone causes a Roblox script to believe that you’re intending to reference the CFrame class/value type as opposed to the property itself, you can avoid this in the same way as I have done in the above by setting the field of the properties table to a string value and enclosing it in a pair of square braces.

1 Like