Yea… it has some issues:
- Diagonal movement was double the speed.
- Had to redo parts to get closest point of border.
- Was frame rate dependant.
- Could not modify radius and set bounds automatically.
- Useless with other than keyboard.
So I redid the math… now it’s a bit more versalite.
- It now works ok(ish) with a controller.
- Radius of bounds updates everything and can changed during gameplay.
- Can get distance and position of closest point in bounds.
- This same math can be modifiied to have the actor/pawn move along the tunnel with impulse rather than in local as it is now… you could have the actor’s forward vector in paralel with the spline without the actor actually being attached to it but it’s a lot of math and I already had my fun.
Anyways, it’s just another option.
Also thank you @MostHost_LA for your feedback (even if it wasn’t for me). Learned a lot and gave me new ideas on how something like this could work. Just hope i was of some help.
The new mess:
Function to limit ship to radius: