- Home /
Spline-based rail grinding
So I'm working on a Sonic fan game using Hedge Physics, and the rail grinding included was never fully implemented and is not only incredibly buggy but also waypoint-based. What I'd like to accomplish is something more spline-based, where A) the player follows the spline at a certain speed going either direction, and B) the player can jump off of the rail at will.
I'm not asking for a full script, I just need a good spline asset (preferrably free or cheap) and somewhere to start on the actual grinding.
It's been a while since posting this, so I figured I'd give an update. I did import the spline part of Surge and did have some very simple version of grinding working but Surge has since updated and broke its Spline Follower script so now I need to find a different way to move the player along the spline.
Answer by MadboyJames · Feb 19, 2018 at 01:09 AM
So I'm here to get some grind rail ideas, and since it's been quite a few months since you posted this, I am wondering if you have found a solution.
Additionally, I have played around with some grind rail mechanics, and would like to share what I have discovered if you are still wondering/ working on this part of the project. I used "Surge" Splines (it has a bunch of different free features, but the Splines extension is the only one I downloaded). I gave each spline an edge collider, and a sub-object called "playerDock". I set it so the dock moved along the rail, and the player had its transform set equal to the transform of the dock. It works, It feels like it's a messy way to do it. So I'm asking around to see if anyone has any better ideas. :)
Answer by Meguia · Feb 19, 2018 at 04:19 AM
Hi @GarryGuertena and @MadboyJames
You can use spline-based procedural geometry. This means that you also can generate the right mesh collider for your geometry.
It's explained in detail in this video: https://www.youtube.com/watch?v=o9RK6O2kOKo
I'm pretty sure that you can download the code if you don't want to write it yourself.
Good luck with your games!