# The end of the Tween is too slow

Hello everyone

I try to advance cars in a linear way but they slow down and I do not know why, I thought easingstyle.Linear would solve this problem but not,
thank you.

the code:

local tweeninfo = TweenInfo.new(2, Enum.EasingStyle.Linear)

``````		local tween = TweenService:Create(Car.PrimaryPart, tweeninfo , goal)
tween:Play()``````
3 Likes

I think itâ€™s because of the tween length. Basically because you made it 2 seconds, the tween has to slow down so it becomes 2 seconds. I donâ€™t have a solution to this though I actually had the same problem a few days ago.

1 Like

if you have out it will make the end faster and in will make in slower

1 Like

This is definitely not a linear easing styleâ€¦

1 Like

And yet I mentioned it in the TweenInfo

1 Like

Maybe you got the easingdirection missing, so i wrote down how i would have scripted it including comments and see if it would solve the issue ur facing. If it is not then feel free to let me know.

``````local goal = {} --- Gives the meaning of 'goal' branches.
goal.Position = Vector3.new(22, 4.5, 39.5)  --- Where it should moves and places the postion in the branches.

local tweenInfo = TweenInfo.new(
2, -- The time the tween takes to complete
Enum.EasingStyle.Linear, -- The tween style.
Enum.EasingDirection.Out, -- EasingDirection
0, -- How many times you want the tween to repeat. If you make it less than 0 it will repeat forever.
false, -- Reverse?
0 -- Delay
)

local tween = TweenService:Create(theCars, tweenInfo, goal) --- Orangises animation (Which part is to be moved, How long it should take, Where it should go)

tween:play()
``````

I I did the TweenInfo like you but the result does not change, the car slows down at the end

2 Likes

Are the parts still collidable, because when parts are moving slowly and next to each other physics can be jittery and cause lag, making it appear to slow down at the end. Itâ€™s strange because it looks more like sine or quad easing style.

yes its very strange, I really do not understand ;(

Do InOut.
Default is quadratic out which starts fast and slows down. Linear out would still have the ending quadratic slowness.

2 Likes

I did InOut and itâ€™s still the same

I see 5 cars, how are you determining the end point for each? Are they all moved separately? How are you moving them? CFrame? It seems they are bumping into each other at times. Very strange it appears that it isnâ€™t doing the linear style properly but maybe something is interfering.

1 Like

donâ€™t worry about that, all cars are independent, the lag that we see between the cars is because of the anti-collision system which stops the Tween if the car gets too close to another

Well, if you simplify and just move one car, see if the linear style works properly. If it does, then its your anti-collision system which is causing the slow down.

1 Like

Yes the issue is present with just one car

Is that all the code? If not can you show all of it?

1 Like

Youâ€™re right, I was focusing on the Tween but in fact the problem was not there, the cars were going slower and slower because the tween was constantly replaying, thank you!

1 Like

Sorry for late respond but nice you figure it out!

ye i understand that issue, thatâ€™s why i keep reverse on false and tween repeat on zero. It was in the script i showed you

1 Like