im trying to make a rail grinding system but i cant figure out how to place the player on top of the rail based on where on the rail they are.
I tried:
rootPart.CFrame = rail.CFrame * CFrame.new(Vector3.new(0,3.5,0))
but that spawns the player above and in the center of the rail.
And I tried:
rootPart.CFrame = CFrame.new(rootPart.Position + Vector3.new(0,(rail.CFrame.UpVector.Y * 3.5),0))
and that works a little better but it always a bit off depending on where the player touched the rail at:
how do I place the player on top of the rail?