Model "snapping" to path during Tween instead of tweening smoothly

Hi! So, I have a model I’m trying to tween across a path I set, and instead of tweening smoothly, it appears to be “snapping” to the paths. It’s really hard to explain it, it’s better if you just see it for yourself:

GIF

viking boat

My Code
local BoatSpeed = 60

function PropelBoat(EndPoint)
	local Distance = (VikingShip.PrimaryPart.Position - EndPoint.Position).Magnitude
	local Goal = {}
	Goal.CFrame = EndPoint.CFrame
	local Tween = Lib.CreateTween(VikingShip.PrimaryPart, Distance/BoatSpeed, Goal)
	Tween:Play()
	Tween.Completed:Wait()
end

VikingBoat.Enable = function()
	for i,v in pairs(VikingShip:GetDescendants()) do
		if v:IsA('BasePart') and v ~= VikingShip.PrimaryPart then
			SharedLib.Weld(VikingShip.PrimaryPart, v)
			v.Anchored = false
		end
	end
	
	while true do
		wait(10)
		PropelBoat(BoatPath.Stop1)
		wait(10)
		for i = 1, 16 do
			local EndPoint = BoatPath:FindFirstChild(i)
			if EndPoint then
				PropelBoat(EndPoint)
			end
		end
		PropelBoat(BoatPath.Stop2)
	end
end

What can I do to solve this?

2 Likes

After review, I’m almost positive it has to do with this line in the code: Tween.Completed:Wait().

This is making the Tween stop along each “node” before continuing to the next node. I don’t want this to happen, but I’m pretty stumped on how I could fix it.

Okay, after doing some research I managed to solve this myself. The issue was I wasn’t setting the EasingStyle to Linear.

1 Like

Your Easing Style appears to be set to Sine.

A linear easing style would stop it stopping and starting at each block.

Not sure what tween module (Lib) you are using but your TweenInfo needs to include TweenInfo.new(..., Enum.EasingStyle.Linear)

3 Likes

The module is my game’s library for commonly used functions. All the functions inside it are my own.

The function before the edit:

ClientLib.CreateTween = function(Object, Wait, Goal)
	local Tween = Vars.TweenService:Create(Object, TweenInfo.new(Wait), Goal)
	return Tween
end

After the edit:

ClientLib.CreateTween = function(Object, Wait, Goal)
	local Tween = Vars.TweenService:Create(Object, TweenInfo.new(Wait, Enum.EasingStyle.Linear), Goal)
	return Tween
end
2 Likes