public void UpdateSpeed(float _speed) { if (state == states.RUN) { aberrationValue = _speed - 0.5f; if (aberrationValue < 0) { aberrationValue = 0; } else { aberrationValue *= 2; } } else { aberrationValue -= 0.05f * Time.deltaTime; } effectsManager.ChangeAberration(aberrationValue); speed = _speed * 10; if (speed > maxSpeed) { speed = maxSpeed; } }