#Not entirely sure what you mean. Can you
1 messages · Page 1 of 1 (latest)
private float _maxAcceleration = 50f;
float dSpeed = Mathf.Max(
Vector3.Dot(
Character.Velocity.normalized,
Character.GetLookDirection()
),
0
) * _maxAcceleration;
Character.Velocity = MovementUtils.ChangeMagnitude(
Character.Velocity,
-dSpeed*Time.deltaTime
);
As implemented here, dSpeed will always be negated (by design), and so in cases like this, I'm tempted to refactor it such that private float _maxAcceleration = -50f;, but I'm always worried about adding/dropping a negative
and I want to stick to some convention just to avoid debugging hell for some logic error caused by this
I think it's fine as you have it now.