I have a working solution to your problem.You need to create a blueprint interface. Name it “Interaction Interface”. Add this to your character, HUD and object blueprints so they can communicate with each other. The process works like this:
- You’ll trace a line from the point of the camera for a certain distance (for visibility channel).
- When the line collides with an inventory object, your character will send a blueprint interface message to that object and ask its name. This ensures that no message will be displayed if the object you’re looking at is not an interaction object.
- The object will send a blueprint interface message and tell its name to the character.
- The character will tell the HUD the name.
- The HUD will draw the name under the crosshair.
Would this be enough for you to figure it out on your own, or would you need some screenshots?