How do I make it so that when I step into a box or a collider that I GUITexture appears?
function OnCollisionEnter()
{
myTexture.enabled=true; //if you want it to appear suddenly. Set it to enabled = false in the inspector beforeā¦
FadeTexture(myTexture); // If you want a fade
}
function FadeTexture(tex : GUITexture)
{
while(tex.color.a!=targetAlpha)
{
//do your thing here. lerp the texture's alpha, or increase it by a fixed amount every frame, whatever suits your needs...
}
}