- Home /
Tunnel Vision Health System
How would I go about making a health system like this one? I am new to scripting so please explain fully. Thank you.
Answer by Berenger · Jan 29, 2013 at 11:17 PM
This is merely a texture display on screen on certain conditions. To go about that, you can use GUITexture, or GUI.DrawTexture.You'll have to play with the alpha, to make it fade in and out, based on your player's health. That will help, probably.
GUITexture + Transparency is an awesome solution for UnityIndie. Since the image gets more transparent towards the center you can get a continuos effect with just 1 image.
Unless you want something more complicated, like $$anonymous$$ass Effect 2 where veins seems to grow toward the middle the more you get hurt.
Answer by schaddemm · Jan 29, 2013 at 11:25 PM
I you use UnityPro you can use ImageEffects, if not you could use a guitexture. Like you make a couple of gui-textures (25% 50% 75% 100%) and display the appropriate one based on his health
if (health<50){
// Assign someTexture to the gui
Texturevar someTexture : Texture2D;
guiTexture.texture = someTexture;
}
if (health<25){etc}
Answer by GeoHazard · Feb 02, 2013 at 08:46 AM
Hey man, Without a doubt the absolute best method is the "screen overlay" script, this is a Image effect only available through unity pro. It looks excellent, you can use any .png image, any color e.c.t then get onto scripts such as the excellent method Schaddemm suggested :)