This should work!
healthbarWidth = (currentHealth / maxHealth) * healthbarOriginalWidth;
I hope the variable names are representative enough!
Hope this helps!
↧