Hi!
I can’t seem to figure out a way to push an object along a path using AddForce. My goal is to only limit the players x axis along a spline, and keep the y and z axis free for jumping and going forward/backwards using AddForce.
I’ve seen some good examples out there like itween and spline walker, but these only reposition the object, and does not use physics to create movement.
Does anyone know how to achieve this effect?
EDIT:
During my testing I’ve made use of a script that I found on this site: Curves and Splines, a Unity C# Tutorial
Maybe I can make this work if I can calculate the closest point to the player on the Bezier Spline. Does anyone know what piece of code I would need for this?
Thanks!