07-08-2024, 09:29 PM
I am trying to make a racing like game, where the character follows a path, and the player controls left and right movement only, as well as jumping. The track has intersections and forks, so you can choose to go left, right, or forwards (or up) depending on your position on the current path.
So far, the volume controller seems the right choice for the left right movement. However, I can't find a way to implement the follow behaviour the spline controller has, to switch splines. And when using spline controller, the character moves back to the center after applying lateral offset.
Right now, I am using a combination of the volume controller, and a script with a reference to the spline it's currently on. I use LastVisibleControlPoint to check when the character reaches the end of the spline, and add left/right/forward/up spline references on that last control point to decide where to go based on position.
I just started using Curvy Splines a couple of days ago, so I'm probably missing something obvious. I feel like there's a better way of doing this, lateral movement and spline follow based on that lateral offset.
So far, the volume controller seems the right choice for the left right movement. However, I can't find a way to implement the follow behaviour the spline controller has, to switch splines. And when using spline controller, the character moves back to the center after applying lateral offset.
Right now, I am using a combination of the volume controller, and a script with a reference to the spline it's currently on. I use LastVisibleControlPoint to check when the character reaches the end of the spline, and add left/right/forward/up spline references on that last control point to decide where to go based on position.
I just started using Curvy Splines a couple of days ago, so I'm probably missing something obvious. I feel like there's a better way of doing this, lateral movement and spline follow based on that lateral offset.