How would I create a rail grinding system?

Id say this is a continuation of this thread right here

I am making a mini project, its a platformer game. I want to add a rail grinding system similar to the sonic games but I have no idea how to. This thread looked helpful but I didnt really get what they were saying. I tried to make the basics of the rail grinding system the way i understood it and it doesnt work at all. Also I need to put these questions in the equation:

How would i rotate the character based off the rail?
How would i connect multiple rails to another?

4 Likes

bumping this. i still need help

bumping this yet again…

chars

Do you already have your platformer system built?

nope. Just to clarify its not going to be a platformer game with complex movements and custom physics.

Why dont you have attachment points on the rail, and then when a player wants to start rail grinding, you just put them at the closest attachment’s position then just move them to the next attachment position

@ebicgamermolment

i thought about doing something like that, but how would you start rail grinding on a specific position of the rail?? also how would you rail grind backwards of the rail?

You could get the direction in which the player is facing and then the direction of the closest attachment, get the dot product of those two vectors then itll tell you how close or far they are facing from each other

And maybe as they are on the rail and moving you can check the attachment they are closest to change directions mid railing

alright ill try this. Ill update yall when I get a result

1 Like

Hello! I’m pretty sure you already recognize me from that said post so i’ll try and get to the point :v

I have the script for it halfway done, though there are several adjustments that I need to make before i’m ready to share

Being as I try to split time for devving and making videos, i’ll will try to get back soon! cheers!

1 Like

thank you! I havent been able to do the method that has been recommended to me cause of school and im also working on other projects. Ill try to study your code to see how everything works when its done. Thanks again!

1 Like

sorry to bump but did you figure this out? I’m having a similar problem