How can I make a railgrinding script

  1. I want to make a script where when the player touches a part, they move to an end point (similar to the rail grinding seen in sonic games).

  2. The issue is that when trying to make a script like this, I’ve essentially just made an ice/slippery block with extra steps.

  3. I’ve tried looking for free models and other scripts people have made, but the very few ones other people have made aren’t able to be edited by me/are too complicated for me to edit into the rail grinding I want

Extra details:
-There would be 2 endpoints (if the player touches endpoint #1, they will move towards end point #2 and vice versa).

-The speed at which they are moving in is dependent on the velocity of the player (If the player touches the rail while going super fast, they will go from point A to point B super fast. If the player is going downwards superfast, (if point B is located under point A) they will move from point A to point B super fast)

-Which endpoint the player moves to is dependent on if the player is moving towards a specific endpoint or not (if the player is moving towards endpoint A while touching the middle of the rail, they will move to endpoint A. If the player is moving towards endpoint B while touching endpoint A, they will move to endpoint B)

This is the current script that I’ve made. It basically acts like an ice block

local line = script.Parent

script.Parent.Touched:Connect(function(t)
	local h=t.Parent:FindFirstChild'Torso'
	
	
	print("Part Touched")
	print(h.AssemblyLinearVelocity)
	--h.CFrame = line.endp.CFrame
	local b = Instance.new("BodyPosition")
	b.position = line.endp.Position
	b.maxForce = h.AssemblyLinearVelocity*Vector3.new(500, 500, 500)
	b.Parent = h
	wait(2)
	b:Destroy()
end)

If there are any resources/open source places/free models with simple, modifiable scripts or has the exact script I’m looking for, please send it to me, otherwise I am just looking for what tools I can use to achieve my goal, so don’t “spoon feed” me unless you send me a link to the resources that I described earlier in this sentence.

bump. I still haven’t found any reliable solutions myself