Looking for someone who could properly model my coaster with Tween/Lerp

Hi! I’m looking for someone who’s able to code a coaster. I’ve made a layout and cart already.

I’ve been trying to script a Tween & Lerp-script myself, but i really can’t figure it out.
This might due to because i’m Dutch. Meaning reading and listening to English tutorials is kinda hard to do sometimes.

I’ve tried using for i in combo with CFrame:Lerp and using Tween:Play(), but couldn’t figure it out.

This is the best i got:

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.1

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

I know requesting someone to write a script/help me, isn’t really appreciated here. But, please. Help this poor user. I really tried my best.

(Edit) The problem with the script above is that the cart stops on every part, instead of going smooth to each other without stopping.

1 Like

Have you looked at the AlignPosition and AlignOrientation objects?
They smoothly move or fix a Part to the position of an attachment.
They’re also easier to replicate between clients.

If you’re dead set on using CFrames, I’ll take a look when I get back to my PC.

1 Like

You can model the coaster with parts and you can make it in model or folder so you can store it in a table and make the cart move smoothly between the tracks with tweenservice and CFrame.
And could make an event when you press a button it starts and like that I don’t really if it does work like that but that what I think of when I read your message

1 Like

I’ll take a look at AlignPosition and Orientation. Never heard of it before to be honest. I’ve learned scripting from tutorials and DevForum Wiki xD.

I’d rather not use CFrame actualy, due to lagg. I’ll let you know if i need some more help.

2 Likes

@WingItMan I’ve been looking for some video’s people using it, and however it’s better then CFrame, there is still the part it stops on every part. And that’s not what i want in a coaster, haha :stuck_out_tongue:

Example video (Look at 5:19)