Hey folks, this issue is so strange that I’m convinced I’ve done something stupid.
I’m building a game with a GUI image using GUI.DrawTexture. When I test the game in Unity, the texture shows. When I build the game for Windows or Mac, it doesn’t. I know it’s not an issue with positioning since I’m setting it to be centered on the screen to be sure it shows up. I’ve also tried other GUI methods like DrawButton and DrawLabel, and they work as expected. I saw someone suggest that I remove my Scene from the build and then re-add it. This had no noticeable effect.
It might be worth noting that I’m porting my code from Javascript to C#, and this exact code and image worked as expected in Javascript.
Anyway, here’s my code:
void OnGUI(){
GUI.DrawTexture(new Rect(Screen.width * 0.5f, Screen.height * 0.5f, 112.0f, 124.0f), timerBar);
}
Any ideas? Thanks!