x


GUI Appear Help

im trying to make GUI appear after the gameobject was been destroyed. heres my script im using:

var MaxHealth : int = 500;

var CurrentHeath : int;


function Start () {

CurrentHeath = MaxHealth;


}

function ApplyDamage ( Damage : float ) {


if( CurrentHeath < 0){


    return;
 }

CurrentHeath -= Damage;

if( CurrentHeath == 0 ){


Destroy( gameObject) ;

}

}

thanks for your help

P.S im new to scripting

more ▼

asked May 09 '12 at 05:22 PM

allenziff gravatar image

allenziff
0 5 7 8

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

What you will like want to do is create a new Prefab game object definition with an attached script that shows the GUI. After you execute the Destroy() of your current game object, you will want to use Instantiate to create a new instance of the Prefab.

more ▼

answered May 09 '12 at 05:27 PM

kolban gravatar image

kolban
1.8k 2 7

Either that or having a single object handling those kinds of GUI. When the allenziff's object is Destroy, he can somehow access that object and tell it to display something with any way he wants, boolean, adding something to a list, etc.

May 09 '12 at 05:33 PM Berenger

i know what your tying to say but i dont know how to do that

May 09 '12 at 05:51 PM allenziff
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5087
x3693
x2090
x764
x36

asked: May 09 '12 at 05:22 PM

Seen: 411 times

Last Updated: May 09 '12 at 05:52 PM