Tweening bug (ROTATION INSTEAD OF MOVEMENT)

Hello, so I have been trying to tween multiple things, and after I rotated the whole model 90 degrees this keeps happening. (Its supposed to go down instead of turning 90 degrees.)

These are the tables for the tweening:

SOLVED

What’s happening here is you’re creating a new CFrame at the position, but in doing this you’re losing the original angle that is stored in the part’s original CFrame. To solve this issue, instead of creating a brand new CFrame and losing the angle, you can translate the original CFrame instead using CFrame*CFrame like so:

local cframe = script.Parent.CFrame
local size = script.Parent.Size

local opena = {
CFrame = cframe,
Size = size
}

local close = {
CFrame = cframe*CFrame.new(0,-2,0),
Size = size + Vector3.new(0, 4.18, 0)
}
1 Like

CFrame contains rotation and position.
If you don’t want the rotation to change you shouldn’t tween to a different rotation.

Your tables but factoring in the current rotation

local Parent = script.Parent
local Cframe = Parent.CFrame
local Size = Parent.Size
local opena = {
    CFrame = Cframe,
    Size = Size
}
local close = {
    CFrame = Cframe+Vector3.new(0,2,0),
    Size = Size+Vector3.new(0,4.18,0)
}