How would i tween a cframe?

ye the title pretty much explains my problem, how do i tween cframes?
here is my current script, no errors, no results.

ts = game:GetService("TweenService")

wait(5)

ts:Create(workspace.Door1,TweenInfo.new(1),{CFrame=workspace.DoorPos.CFrame}):Play()

Put the last line like this:

ts:Create(workspace.Door1,TweenInfo.new(1),{["CFrame"]=workspace.DoorPos.CFrame}):Play()

So that it takes the CFrame of the object.

4 Likes
game.TweenService:Create(item,TweenInfo.new(1,Enum.EasingStyle,Linear),
{CFrame = yourFrame})

Where yourFrame is a CFrame like object.CFrame or CFrame.new(position).

@SOTR654 used the table {["CFrame"] = ...}, you can just use {CFrame = ...}.

Anchor the part you’re tweening.

Anything unanchored and welded the anchored object being tweened will move with it.

4 Likes
ts = game:GetService("TweenService")

wait(5)

ts:Create(workspace.Door1,TweenInfo.new(1),{CFrame = workspace.DoorPos.PrimaryPart.CFrame}):Play()

don’t forget to weld all part to main(PrimaryPart) then tween PrimaryPart,your all parts will move

its pretty simple.

		local TweenService = game:GetService("TweenService")
		local TweenPart = workspace.Door1 -- your tween part
		local TweenInfo = TweenInfo.new(
			1,    -- sec
			Enum.EasingStyle.Cubic,
			Enum.EasingDirection.Out,
			0,  -- loop 
			false, -- reverse
			0  -- delay
		)
		local TweenGoals = { -- these are goals which are like properties of the part you can add as many of them like size, position, orientation 
			CFrame = workspace.DoorPos.CFrame,
		}
		local TweenTrack = TweenService2:Create(TweenPart, TweenInfo, TweenGoals) -- tween track

		TweenTrack:Play() -- plays the tween
1 Like