Hello,
I'm trying to make an image show up when the player clicks on one of the objects in my game. However, the code doesn't seem to be working. Can someone experienced help me?
Thank you so much!
Here's the code:
bool showPaw=false;
public Texture2D catPaw;
void OnMouseDown () {
showPaw = true;
Destroy(this.gameObject);
}
void OnGUI (){
if (showPaw == true)
GUI.DrawTexture(new Rect(0,0, 100,100),catPaw,ScaleMode.ScaleToFit);
Debug.Log("CAT PAW!!");
}
}
↧