Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some help to achieve reverse spline walk
#2
What you want to know is this piece of information: "Note that speed changes the movement direction only if it was “0” before!" I missed to update the docs (just did it!), so it was only present in the changelog - sorry.

So you'll need to change your code like

Code:
float newSpeed=Speed+someacc;
if (Mathf.Sign(Speed)!=Mathf.Sign(newSpeed))
{
Speed=0;
Speed=newSpeed;
}

I agree that this is somewhat odd, but it was the most reliable way to solve a problem when moving over several connected splines. It's most likely that this behaviour will drop in the future in favor of a more sophisticated solution, though.
If you don't like that behaviour, just override the Speed property in your custom controller and remove the "m_Speed==0 && " condition in the property's setter!
Reply


Messages In This Thread
RE: Need some help to achieve reverse spline walk - by Jake - 06-29-2016, 04:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to duplicate a spline with an offset Kapistijn 8 1,416 04-12-2026, 03:18 PM
Last Post: _Aka_
Smile Constant speed along a spline? tfishell 1 665 11-13-2025, 11:32 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,474 07-29-2025, 09:15 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 7 6,259 07-13-2025, 07:11 PM
Last Post: _Aka_

Forum Jump: