i am trying to make a script to cycle through textures on a model.
i am setting a main texture and then rotating from there and back to it.
i also have a bump map that does not change.
var image1 : Texture;
var image2 : Texture;
var image3 : Texture;
var normmp : Texture ;
function Start (){
renderer.material.SetTexture("_MainTex",image1);
}
{
renderer.material.SetTexture("_BumpMap",normmp);
}
function Update (){
if(Input.GetKey(KeyCode.Q));
{
switch (renderer.Texture)
{
case image1:
renderer.material.mainTexture = image2;
break;
case image2:
renderer.material.mainTexture = image3;
break;
case image3:
renderer.material.mainTexture = image1;
break;
}
}
}
the initial texture (image1) and the normal map load fine.
when i press “Q” it does not cycle. cant get where i’m going wrong. any help would be much appreciated.
sorry its 2 am and i am very repetitive.
(stuck in a tired loop)