Array with many Texture2D s - can't use .length/width

Hey guys,

I need some help on this small codesnippet:

void calcSize(int eventNumber){
			float ratio = 0;
			
		if(textures[eventNumber].width > textures[eventNumber].length){
			
			ratio = textures[eventNumber].width / textures[eventNumber].length;
		} 
		
		else if (textures[eventNumber].width > textures[eventNumber].length){
			ratio = textures[eventNumber].length / textures[eventNumber].width;
		}
		

		float x = transform.localScale.x;
		float yNew = x * ratio;
		transform.localScale = new Vector3 (x,yNew,0);
	}

Error Message:

It looks like that I can’t readin the width and length of the textures saved in an Array.

I’m thankful for any help !!!

Its called height not length :wink:

Way to behave like a dougebag :smile:

Thanks, have been wandering around for hours.

It’s a good idea to look in the docs when you get errors like that, so you can see what the actual variables are without having to spend hours.

–Eric

Well found it a little amusing you didn’t just look it up in the scripting reference