- Home /
Script Problems?
Hello, i have this script but i want it to not be gui. so can you guys help me convert this into the 2d toolkit sprite so it will let me put sprites in there instead of gui thanks.
#pragma strict
var health3 : Texture2D;
var health2 : Texture2D;
var health1 : Texture2D;
static var LIVES = 4;
function Update (){
switch(LIVES){
case 3:
guiTexture.texture = health3;
break;
case 2:
guiTexture.texture = health2;
break;
case 1:
guiTexture.texture = health1;
break;
case 0:
//gameoverscripthere
break;
}
}
what do u want exactly? are you trying to not use the GUITexture component? do u want to use the OnGUI() function?
We're not really here to do stuff for you, so much as we are to help out when you get stuck doing it. Someone nice may come along and do it for you but I like to see that an attempt has at least been made :)
Answer by tw1st3d · Aug 29, 2012 at 05:34 AM
What you can do is use planes, and then define the plane size, position, color, picture, etc. through your script. This would eliminate the need for OnGUI()
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Unity crashed, then alll scripts can't be loaded 8 Answers
Have a 'Torch' script toggle on and off 1 Answer
I need help instantiateing a bullet 0 Answers
Make Script Disable 3 Answers