Help creating a rail slide mechanic

So I have this big downstairs bridge with a railing on the side and I want players to be able to slide on it to get downstairs faster. I can figure out the animations but I can’t figure out how to code it. I want the player to be sitting on the rail so I added an attachment on the hrp which is supposed to follow the railing and keep the player in track, but I don’t (again) know how to code this. BodyVelocity? VectorForce? TweenService?

3 Likes

Maybe Tweenservice will be the best option.
When the player want to do the rail slide mechanic you can get X/Z axis of the player and the end pos of the rail, then you make the position tween and put the animations,
you should need 3 animations using this method, one when the player starts doing the mechanic, one when the plr is in the rail and other when the plr leaves the rail.

If you want to do it that the player can only do the mechanic in the top of the rail its easier, just put starting pos of the rail and the end pos of the rail, then tp the plr to the starting pos, and play a single animation, wait a bit and while the animation is being played you start tweening it.

maybe an easier one is just playing an animation and tp the player to the last position of the animation I guess but I dont really know if this works.

1 Like