View Single Post
07/03/15, 11:27 PM   #5
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
I'd try to stick to the Animation system if at all possible. Unless you're careful, you can easily do too much in an OnUpdate and cause an FPS drop. For example, that code runs every frame whether it needs to or not. Also, you're not guaranteed to actually hit your end value but could end up oscillating above/below. That part could actually be what's causing the shadow. Furthermore, that's rather brittle and doesn't allow you to change a set duration; it will change at the same speed whether you need to go a small part of the bar or the whole thing.

The animation system will handle register/deregister of the update handler for you. It's also more keyed to how long the animation is, which is more critical. The player should be able to look at the bar after .3s, .5s, probably 1s at the most and see the correct value. And if it's a small change, you can still take that time and have a smoother animation.
  Reply With Quote