I just released a new package: Moba Style Energy Bars in the asset store. With this package you can easily add value bars to your game that are divided into cells which indicate magnitude to the player.
There are two parts to this package:
Several custom made floating health bar prefabs you can drop straight into your game. Very easy to set up, they follow your game objects from a specified offset and they support screenspace or worldspace modes.
Editor controls to add these energy bars to your own GUI objects. Choose their textures, gap sizes, gap frequencies etc.
If you’re interested in having health bars like these in your game please check the package out. Let me know if you have any questions. I’ll post about any updates to the package here. Also, since this is my first package for the asset store any feedback on the store listing would be appreciated. Thanks!
Hey I just bought the asset, and it works great. I’m tweaking it a bit to suit my needs, and integrating it with my existing architecture, but thanks for making this.
I like that it uses a shader, instead of layered images, and that the texture is stretched, instead of segmented together in pieces. I also like that you made a Screen Space Overlay option, and not just making everyone use World Space.
A couple ‘feature requests’, would be an option to use a texture for the burn, and to be able to reverse the direction of the ‘remainder’ health cell. I’m doing this myself, but it would be nice if it was a built in option… so instead of the left over health being on the left side, I want it on the right.
I’ve uploaded a version containing the features you’ve suggested, including textures for the burn and an option to flip the direction of the energy bars. Hopefully it’s available soon!
Already downloaded and implemented I use StrangeIOC extensively, so I ‘strangified’ everything, and added in sorting based on Y value(game specific). I also made UpdateBar a coroutine, which runs while damage > 0 && Value > 0 and yield breaks at the start if damage > 0, so if it’s already running, it won’t run again.
The other thing I noticed, which you might be interested in, is a slight glitch with damage+burn+healing. To replicate it, put a pretty long burn on the burn rate, like 0.01, then quickly damage, and heal, then damage and heal, etc a bunch of times, then damage all the way, but don’t heal.
Notice that the burn has extended way beyond the health bars Max value, and takes a while to burn back into the frame of the health bar. I’m not sure if this is something you need to deal with, or just an implementation thing.
Thanks again for this plugin, makes my life way easier.
@AdamAlexander could you upgrade the shader to handle 2 separated values with different colors?
Health and shield for example, I uploaded a demo showing my desired result, I used sprites for health and shield bars and your shader only for the intervals and burn effect(which isn’t workig properly not sure why).
You’ll need to place multiple energy bars directly next to each other, since each bar can only be configured with one colour. Glad youre finding it useful!
hmm maybe you could try putting the energy bars in a horizontal layout group. Then you could have the Unity UI system automatically position them given the amount of available space.