diff --git a/Source/Engine/UI/GUI/Common/ProgressBar.cs b/Source/Engine/UI/GUI/Common/ProgressBar.cs index 4852865bf..67f521c4a 100644 --- a/Source/Engine/UI/GUI/Common/ProgressBar.cs +++ b/Source/Engine/UI/GUI/Common/ProgressBar.cs @@ -143,9 +143,11 @@ namespace FlaxEngine.GUI if (!Mathf.NearEqual(value, _value)) { _value = value; - if (!UseSmoothing) + if (!UseSmoothing || _firstUpdate) { _current = _value; + if (_firstUpdate) + _firstUpdate = false; } } } @@ -169,6 +171,9 @@ namespace FlaxEngine.GUI [EditorDisplay("Bar Style"), EditorOrder(2012), Tooltip("The brush used for progress bar drawing.")] public IBrush BarBrush { get; set; } + // Used to remove initial lerp from the value on play. + private bool _firstUpdate = true; + /// /// Initializes a new instance of the class. ///