Problem ProgressBar with health + Time the poison

Hi, I have a problem with Progress Bar with health + Time the poison, Player get marker (gameobject) no poison and up health… and my code is error

var health : int = 100;
var healthTexture1 : Texture2D;
var healthTexture2 : Texture2D;

function OnGUI () {    
    GUI.DrawTexture(Rect(55,Screen.height - 55,100,5), healthTexture2);

    var boor : int = health * hePoison; 
    GUI.BeginGroup(Rect(55,Screen.height - 55,boor,15));
    GUI.DrawTexture(Rect(0,0,100,5), healthTexture1);
}

function Update(){
    hePoison = Time.time * -0.01;
    heMarker = Time.time * 0.15;
}

Hi, Sorry i long not type to comment, This Is bad my script, I idea… Player has 60 second to die, Player must move to marker (gameobject) here and give you up time, do you know? How not understand it type comment.


I have problem script, Script’s can’t up the bar, and time it 0.05 bar is 1 it’s can’t.
My code:

var progress : float = 1;
var progressmin : float = 1;
var pos : Vector2 = new Vector2(20,40);
var size : Vector2 = new Vector2(60,20);
var progressBarEmpty : Texture2D;
var progressBarFull : Texture2D;
var Point : Transform;
var Player : Transform;

function OnGUI()
{
    GUI.DrawTexture(Rect(125,Screen.height - 75,135,20), progressBarEmpty);
    GUI.DrawTexture(Rect(125,Screen.height - 75,135 * progress * progressmin,20), progressBarFull);
} 

function Update()
{
    progress = (Mathf.Clamp( Time.time, 0, 1))* -0.05;
}

function Download()
{
	Point.parent = Player.transform;
	progressmin = (Mathf.Clamp( Time.time, 0, 1))* 1;
}

hePoison and heMarker are not declared. Plus, you need to call GUI.EndGroup at the end of your OnGUI, as you called GUI.BeginGroup before.

Could you rephrase your question ? Or post it in your own language, I’m sure someone can help with the translation.