Why isn't My Tween moving Smoothly

Hello! So I’m practicing tween service, but the issue is my part wont move smoothly, It Instantly goes to the goal position

local TweenService = game:GetService("TweenService")

local Part = script.Parent

local goal = {}
goal.Position = Vector3.new(100,100,100)
goal.Color = Color3.new(1, 0, 0)

local tweenInfo = TweenInfo.new(10)

local tween = TweenService:Create(Part, tweenInfo, goal)

tween:Play()

Try chaning your tweenInfo to:

local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true, 0)
1 Like

Is the part anchored? Because of the way physics work.

1 Like

Can you explain to me what Enum.EasingStyle Is? and EasingDirection?

and the line of code?

Yes it is, If it wasn’t that wouldn’t work at all

Its basically just how smoothly it moves you can see here

Also is it just that code in one script? so it runs instantly?

Because of so it looks like it moves instantly because it needs to load the camera and such.

So just put a wait of like 1 or 3 seconds

2 Likes

Sure thing, sorry I didn’t.
Essentially, when you use TweenInfo.new(), it takes in a few different arguments.
I’ll describe them in this following code block.

local tweenInfo = TweenInfo.new(
	10, --This is the duration of the tween
	Enum.EasingStyle.Sine, --This is how the tween moves (https://developer.roblox.com/en-us/api-reference/enum/EasingStyle)
	Enum.EasingDirection, --This essentially changes the "direction" of the tween (https://developer.roblox.com/en-us/api-reference/enum/EasingDirection)
	-1, --This is how many times the tween will repeat itself (a negative means infinite)
	true, --If true, the tween will use the arguments above to go back to its original position. If false, then it will teleport back without tweening itself
	0 --This is the delay before teleporting/re-tweening itself to the original position
)
2 Likes