Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

:Lerp model does not goes smooth?

Howdy!

First, check this GIF: https://gyazo.com/692e331b2b8664da939ae95d57d65977

Second, i made this script:

local Cart = workspace:WaitForChild('Train1')
local Train1 = Cart:WaitForChild('FrontCar')
local ThisCar = script.Parent
local Tracks = workspace:WaitForChild('Tracks')
local TrackNumb = 1
local Int = 0.01


repeat
	local Stop = script.Parent.StopValue.Value
	Finish = workspace.Tracks:FindFirstChild('Part'..TrackNumb).CFrame
	for i = 0,1,Int do
		local CFrameMath = script.Parent.FrontCar.PrimaryPart.CFrame:lerp(Finish,i)
		Train1:SetPrimaryPartCFrame(CFrameMath)
		wait()
	end  
	TrackNumb = TrackNumb +1
	if TrackNumb >6 then
		wait()
		TrackNumb = 1
	end
until Stop == true

Now, as you can see on the GIF, my train stops at every Brick. But i'd like it to not stop on every one, but go towards it and when nearby to it, it goes to the second, and so on the third, fourth, fifth, and so on.

People have been telling me to go on Tween, but tween does not make a train properly go make a turn. So i'm stuck to CFrame. But, now this is the struggle i got to deal with.

Any captain here so serve this poor citizen?

1 answer

When the block is moving, you must make it move like legit ever 0.3 seconds for it to run smooth, you might also have to add a speed. Sorry I wasn't helpful but here is a link to a guy that is perfect at explaining that.

https://www.youtube.com/watch?v=Yhg6_2UjtCM

Hope this message or link helped!

1 comment

0

I've seen his video yeah. I'll take a look at it again

This discussion is preserved as it was. New answers, comments, and votes are closed.