How to change a texture of a gameobject by collider trigger ?

Hi,

This is the situation. I have a third person character walking on a path. Whenever he walks trough a "pick up" I want the texture of the path to change.

I've tried this :

function OnTriggerEnter (other : Collider) {

renderer.material.mainTexture = "Asphalt";

}

But it doesn't work. Actually as you may have notices i'm quite new to scripting (A)

Can anyone help me out ?

Thanks,

Niels

You can use this script...

var yourTexture : Texture;

function OnTriggerEnter (other : Collider) 
{
    renderer.material.mainTexture = yourTexture;
}

I think it can help you.