- Home /
update GUI texture when a enemy car dies
I want a GUI Texture to get updated every time a enemy car (that is attached to public var car) is destroyed. the game starts at 5 enemy cars by the way.
public var car : Transform;
function OnCollisionEnter(col: Collision){
if(col.gameObject.name == "computer car moving"){ Destroy(col.gameObject); } }
What do you want to update? you need to state clearly if you want your question to be answered by ppl.
Answer by Unamine · Jun 13, 2011 at 10:56 AM
I understand that the texture gui shows the number of cars in the game.
Then create an array with five values (which are the number of cars enemies), and store an image every one, after you check if any car was destroyed in its function as demonstrated by cases replace, its texture.
Any questions, ask ...