TweenService not working?

When I tween parts, it always go to position 0,0,0?

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
	4, -- Time
	Enum.EasingStyle.Sine, -- EasingStyle
	Enum.EasingDirection.Out, -- EasingDirection
	0, -- RepeatCount (when less than zero the tween will loop indefinitely)
	false, -- Reverses (tween will reverse once reaching it's goal)
	0 -- DelayTime
)

local tween1 = TweenService:Create(script.Parent.Parent.Parent.Parent.Enter, tweenInfo, {Position = Vector3.new(script.Parent.Parent.Parent.Parent.EnterPos1.Position)})
local tween2 = TweenService:Create(script.Parent.Parent.Parent.Parent.Enter, tweenInfo, {Position = Vector3.new(script.Parent.Parent.Parent.Parent.EnterPos2.Position)})

There are no errors in output? Could anyone help me?

Check the position of your parts. Also, I assume you’re tweening Enter to the position of EnterPos? Perhaps try removing the Vector3 and index position like so: Also, are your parts anchored?
{Position = script.Parent.Parent.Parent.Parent.EnterPos1.Position})

Try using CFrame instead

{CFrame = script.Parent.CFrame * CFrame.new(0, -2.2, 0)}
Full script:

local ts = game:GetService("TweenService")
local info = TweenInfo.new(
			1.5,
			Enum.EasingStyle.Quad,
			Enum.EasingDirection.InOut
		)
ts:Create(script.Parent, info, {CFrame = script.Parent.CFrame * CFrame.new(0, 0, -0.4)}):Play()
Smaller version of script

game:GetService(“TweenService”):Create(script.Parent, TweenInfo.new(1.5, Enum.EasingStyle.Quad,Enum.EasingDirection.InOut), {CFrame = script.Parent.CFrame * CFrame.new(0, 0, -0.4)}):Play()

Did this thing enabled? in Home > Game Settings > Security

Umm, how is this even related?

1 Like

image

You don’t need that for TweenService.
OP is probbably having problem with part being rotated and moved to 0, 0, 0 he needs to use CFrame insead vector3 for that.