GUI Texture - from Box to Camera


I’m using this code to make an image appear when the player collides with an object

function OnTriggerEnter (Player : Collider) {
	if(Player.gameObject.tag == "Player") {
		GUI.DrawTexture(new Rect(0, 0, 10, 20), noteMessage);

But, I don’t actually know how to make it appear on screen - I keep getting some critical error. I know it has something to do with putting it ‘on’ the camera, but I am unsure how.

GUI.DrawTexture can only be used inside OnGUI(). So in your OnTrigger set a boolean variable to true, and then write an OnGUI() which uses this value to decide whether to display the texture or not.