Help with tweening a model

Hello, I want my door to go up. Everything I change makes it go to the side.
How would I change this to make my door go up?

local tweenOuter = ts:Create(outerPrimary, doorTweenInfo, {
	CFrame = outerPrimary.CFrame * CFrame.new(outerPrimary.Size.Y + 0.1, 0, 0)
})

You are adding it on the X axis. Add it on the Y axis.

1 Like

I already tried adding it on the Y axis. This is what I did.

CFrame.new(outerPrimary.Size.Y + 0, 0.1, 0)

No that’s not.

THIS.

CFrame.new(0, outerPrimary.Size.Y + 0.1, 0)

Oh, I see what you mean now! Thanks!

I have a question.
How would I make it go back to the exact same spot after three seconds. Here is what I have but it’s not working.

local tweenOuterOpen = ts:Create(outerPrimary, doorTweenInfo, {
	CFrame = outerPrimary.CFrame * CFrame.new(0, outerPrimary.Size.Y + 0.1, 0)
})

local tweenOuterClose = ts:Create(outerPrimary, doorTweenInfo, {
	CFrame = outerPrimary.CFrame * CFrame.new(0, outerPrimary.Size.Y - 0.1, 0)
})

Save the original CFrame and pass that as the goal. Offsets only need to be applied when you’re displacing the object. If you want the original positioning then you should be saving it somewhere so that you can pass it as a tween goal for the “close” tween.

2 Likes

Would I save the original CFrame in a variable?

Thanks! That worked, really appreciate it.

local tweenOuter = ts:Create(outerPrimary, doorTweenInfo, {
	["CFrame"] = outerPrimary.CFrame * CFrame.new(outerPrimary.Size.Y + 0.1, 0, 0)
})

I believe you already made this thread but it’s because the script believes your reference to CFrame is a reference to the CFrame class/value type not to “CFrame” as a property, to avoid this you just do as I have in the above this instructs the script that you’re referring to CFrame as a property and not as a class.