Hello! For my 2D action RPG I've created an XP bar using TextureProgress, which fills as you make progress toward the next level-up. It works great, but I want to tween the value so the increase is animated, instead of making a sudden jump.
I put this in my _ready():
function
$Tween.interpolate_property($ExpUI_2, "value", start, end, 0.5, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
$ExpUI_2
is the TextureProgress bar node, 'start
' is the initial value, and 'end
' is the final value. And then whenever the XP changes, I call:
$Tween.start()
The bar continues to fill as before, and I've used print(start, end)
to confirm that it's correctly capturing the start and end values, but there's still no animation - just abrupt jumps in the TextureProgress value.
Any obvious mistakes I'm making, or ideas for how to debug this problem? Thanks, y'all!