06-29-2016, 04:14 PM
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
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!
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!