Tweened Part not tweening correctly

Hey there!

I am trying to tween a part for a door that slides. However, whenever I play the tween, instead of going along the axis (the z axis) it moves to the side and then down. I have tried changing the values, but nothing seems to work.

Here’s my script, used with a wedge for a sliding door:

local TweenService = game:GetService("TweenService")

local Wedge1 = script.Parent.Parent.Wedge1

local Wedge2 = script.Parent.Parent.Wedge2

local Info = TweenInfo.new(

3,

Enum.EasingStyle.Sine

)

local Wedge1OpenGoals = {

Position = Vector3.new(0, 0, -15)

}

local Wedge1CloseGoals = {

Position = Vector3.new(0, 0, 15)

}

local TweenTest = TweenService:Create(Wedge1, Info, Wedge1OpenGoals)

wait(10)

TweenTest:Play()

Hmmm strange, try using Position Values instead of Vector3 values.

local TweenService = game:GetService(“TweenService”)

local Properties = {

Position = Vector3.new(22, 19.9, -138.19) – See how its a Postition Value

}

local Info = TweenInfo.new(7,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)

local Tween = TweenService:Create(script.Parent,Info,Properties)

Tween:Play()

You are a lifesaver, thank you!

I didn’t know that using Vector3 set the position instead of adding to it. Thanks!