public static float FloatUpdate(float currentValue, float targetValue, float speed) { float diff = targetValue - currentValue; currentValue += (diff * speed) * Time.deltaTime; return (currentValue); }