Topic was automatically imported from the old Question2Answer platform.
Asked By
samjmiller
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.
$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!
where $ExpUI_2.value will make the animation always start from the current position, avoiding the sudden jump
Yeah, I do have my variable “start” capturing the initial value and my variable “end” set capturing the updated value - the bar is correctly increasing from the current value to the updated one, the issue is that it doesn’t animate - just an abrupt jump (from, say, 25% to 50%).
samjmiller | 2021-08-18 16:24
Any chance the step value of the TextureProgress is too big to see the change?
This jump still happens with a larger tween time?
gramozilho | 2021-08-18 18:55
No - same problem when I increased the tween time, or tried smaller step values.