renderer.material.mainTexture not changing texture...

Hello. In my game I have am using the renderer.material.mainTexture = texture to change the texture of an object, but while the script keeps working, the material does not change, even though I filled in the areas specifying what textures I meant. Thank you in advance.

HA! FIXED IT!

Used renderer.mater.SetTexture("_MainTexture, texture"); instead.