How to make an interaction system?

I’m making my first game, and trying to do something as simple as an interaction system for it
I’ve been searching for YouTube videos but I can’t find one that works

Here’s exactly my idea; the player goes into a box collider I made, with the “IsTrigger” activated, and it should:

  1. Show a “Press E to interact” text, maybe having it on the canvas so I don’t have to make it for every object

2.Make it so you can interact when pressing E, and show a dialogue buble I already made

So I’d like to know how to implement a interact system and how to show objects only when interacting, specially the scripts needed

Thank you so much if you are reading this, and extra thanks if you help me!

That’s quite a lot for one question but for the actual detection and button press, I’d do it from the player perspective. Don’t make the object you want to interact with detect the player, make the player detect the objects trigger zone, then when E is pressed, call a script on the object that the trigger zone belongs to in order to trigger the interaction.

This way, your detection is handled all in one place, and objects you can interact with aren’t handling inputs