Resources.Load texture problem in function Update

If I create an instance in “function Start” and give it a texture like below it works:

function Start () {
    var instance : GameObject = Instantiate(Resources.Load("103")) as GameObject;
    instance.renderer.material.mainTexture = Resources.Load("entextur");
}

…But if I do the same thing in a “function Update” it doesnt. Like this:

function Update () {

if(Input.GetMouseButtonDown(0)  Input.mousePosition.y < 200){

 var instance : GameObject = Instantiate(Resources.Load("103")) as GameObject;
    instance.renderer.material.mainTexture = Resources.Load("entextur");
}
}

Why doesnt it work and how do I make it work?

I don’t think you can. Using Awake ( ) and Start ( ) functions are setting things up as a OneShot before it gets to the Update ( ) function which cycles.

if you are wanting to change a texture you would have to declare a variable of entextur as a Texture2D and assign your texture there then just call the texture within the update using

instance.renderer.material.mainTexture = entextur;

im not sure what you are wanting to do so this is the best advice i can give unless you specify your desired effect.