Making instructions pop up when in certain areas

How would one make a dialogue box appear similar to how text dialogues will show up in games like “Amnesia” or “Half life” when a player enters a certain area (For example, when you enter an area where you need to crouch, it’ll inform you to press C to crouch)?

For example

If there was a log on the ground and the only way past it is to jump over it, how would I make text fade in that says “Press spacebar to jump” that will appear when near the object and fade out cosmetically?

Not sure if this is overly complicated, I’ve just struggled to find working scripts for this.

its actually very easy. just make an invisible trigger and have an empty gui text on the screen so when the player enters it u display the text, and on exit u erase it.

by steps: make the trigger on an empty game object just add a box collider and set it to trigger.

make a guitext and set it on ur screen.

attach this script to ur trigger. and in the inspector sset the referencetotext value the guitext. and u r done.

public GUIText referencetotext;

void OnTriggerEnter(Collider hit){
    referencetotext.text ="Necesito mas comida";
}

void OnTriggerExit(Collider hit){
    referencetotext.text ="";
}

**edit:**oh btw its C#