Enable a GUI texture after player collides with another object

So I've got the object colliding part done but I don't know how to enable a GUI texture after the collision.

Any ideas?


P.S. Using J script.

Assuming your GUITexture is not on the scripted object, but somewhere else, and you don't mind dragging it onto the public variable of the script in the inspector, something like this should work:

var tex : GUITexture;

function OnCollisionEnter(collision : Collision)
    //your code
    tex.enabled = true;

I have same problem, and I discover this way is also fine

var showHPBar:GUITexture;
var MaxHP:int = 1000;
var HP:int = 500;
function Update(){
function showHP(){    
if(MaxHP != HP){