- Home /
How to create a HUD item like DeadSpace Stasis Meter?
I am curious how I can create a HUD item like the Stasis meter in DeadSpace? I have done something similar in another engine, but this involved cutting the whole image into 100 sections and basing the player's health as percentage(I did it with 10 pieces of the image because 100 is a lot). Anyway my method for Unity would be creating 100 pieces of the health meter being completing full then 99% a slight piece missing and then if health was 50% to be health of the full image, and so on. Is this the only way to approach this? Or is there animation approach? I know the health in the FPS Shooter tutorial, but this I believe is a horizontal bar just being scaled down, which doesn't work with a curved image.
Would this Shader idea be a possible solution?
are you interested in using a GUI or 3D object of some kind?
Answer by Adam 10 · Oct 22, 2011 at 07:42 PM
I used a 3D Object with Ortho 2nd camera on it then just rotated the curved objects a percentage as they took damage or used energy. If I want so make it smoother I will use the above answer, but everyone is happy with this right now. Just had trouble positioning it at different Resolutions and aspects at first, but I think thats all worked out too.
Answer by Eric5h5 · Jan 31, 2011 at 05:16 AM
Answered here: http://answers.unity3d.com/questions/7449/creating-a-circular-progressbar-timer/7474#7474
Well this does look exactly what I want of course not based on the mouse, but it is not clear to me on how to use it. $$anonymous$$ind of sad considering the package is there. Would I use a GUITexture and apply this? I don't know much about shaders.
You can't use GUITexture, and you don't need to touch shaders. Just open the package and look; there's hardly anything to it. There's one line of code, and the relevant part is renderer.material.SetFloat("_Cutoff"
. What you set it to is up to you.
Opps, when I added the package I didn't see there was a scene to load I am playing it now. Didn't work on first try, but in the background it is trying to change things, so maybe its how I have it positioned. Thanks for pointing me in the right direction.