Button when clicked doesn't draw texture

GUI.skin = storageSkin;
GUI.DrawTexture (new Rect (xTestStart, yTestStart, xTestFinish, yTestFinish), background, ScaleMode.StretchToFill, true, 0);
if (GUI.Button (new Rect (1125, 25, 40, 40), “”))
{
GUI.DrawTexture (new Rect (xTestStart, yTestStart, xTestFinish, yTestFinish), background, ScaleMode.StretchToFill, true, 0);
}

This is the code I have and the first drawTexture will appear on the screen but the other won’t. This seems really odd and have no idea what could possibly be the cause. Can someone help me? Is there some rule I have missed? Any help is appreciated :slight_smile:

Besides the fact that the two calls to DrawTexture are exactly the same (so I don’t understand how you’d notice anything different), but your code wouldn’t work anyway because you have put the second DrawTexture inside the GUI.Button statement and it’s called only in the frame when the click happens. Instead you should declare a Texture variable in your class, assign it inside the button statement and draw it if it’s not null outside of the button statement (after it)