Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Freewalk mode, then return to spline
#1
I want to offer my users the ability to turn off the guided spline and walk wherever they want.  So they can go off course a bit.  But if they get lost, they can hit a button and I'll find the nearest CP and set a course to that CP.

I've gotten it to kindof work so far.  But something really odd happens.

So my idea was that after I toggle on freewalk mode, it will remove the spline from the player's SplineController.  When I toggle it back on a few things occur.  It will find the nearest CP through a simple distance calc; it will InsertBefore that nearest CP with the position at the players current position; once it reaches the CP first found, it will remove the 'virtual' one I created to smooth out the path, and the original spline should look the same.

It actually works!  Except, my player is FOREVER offset from the distance that he veered off course.  I even set the spline controllers relative position to the same one that's generated from the new InsertBefore CP (say, 0.371293) thinking that it might help.  No.  It's weird that creating a CP right on top of my character, and also setting the position to that CP, would jolt my character a few feet off.

Any thoughts on this?  I'm honestly surprised this happens at all... not even sure what method to play with to ensure I can reenable the spline and walk upon it as if nothing changed.
Reply


Messages In This Thread
Freewalk mode, then return to spline - by mythstified - 08-27-2018, 03:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 1 1 Yesterday, 10:12 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 2 Yesterday, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 13 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: