I destroy the object but the GUITexture did not appear

var GUIbalisong: GameObject;//guitext to

var toBEdestroyed: GameObject;// ung object na masisira

function OnTriggerEnter (other : Collider)

{

Destroy(toBEdestroyed); // call the function Show in the BalisongScript.js

GUIbalisong.enabled = true; // disable guiTexture

}

function Show() { guiTexture.enabled = true; // enable the guitexture

yield WaitForSeconds(5); // 5 seconds delay

GUIbalisong.enabled = false; // disable guiTexture

}

1 Answer

1

@larrielyn, I answered your question how to add time ? (how to show a guiTexture and hide it after some time?) - Questions & Answers - Unity Discussions - it was tested and worked fine. You should post comments with add new comment in that answer instead of posting new questions, so we could analyse the problem taking all the previous history into account. It’s much like going to a new doctor just because you didn’t like the diagnosis of the others: you may end dead, and let a lot of doctors studying your case!

Anyway, in that answer I told you to create a script called BalisongScript.js and attach it to the GUITexture balisong. The other script should be attached to the trigger object. When the trigger object was destroyed, it would call the Show function in BalisongScript, which would show the texture for the time specified, then hide it.