Raycasting a 2D image inside a 3D map and information appears...

I am programming scripts for a 3D map in Unity. I want the user to press a billboard 2D image or an object and some information about this location will appear to his/her screen with GUI. I have already tried various scripts but im new to Unity and i got confused with the steps. How can i adjust the script inside the objects and make it active> Could someone help me and tell me some steps that i can follow?..Also i would appreciate if you find similar scripts about my situation…Thank you very much for your time…
P.S. i’m using C#

When you say billboard 2d image - is that in the UI?
When you say “or an object” - is that in the regular (3d) world (not canvas*)?

Without more information, I dunno what might work best, but if it’s in the canvas, you can make it a button or implement the IPointerClick interface.
For an object in the world, a very simple way to get a “click” is to use the method “OnMouseClick” (just ensure that the object has a collider).

As for the last part, just displaying the information in the UI… that’s pretty straightforward, I think. I wasn’t sure if you wanted any help with that, so I won’t say anything unless you do.

It’s gonna be an interactive 3D map, the 2d image is inside the interactive 3d world using the billboard script to face always the camera. The object isn’t inside the canvas either, it is inside the 3d world. The user must click the icon or the object (in this case is a house) to view some information about it in Canvas which is the UI…im really sorry about my description, im just an amateur…

Okay no problem… So, if the house has a collider, you can implement the method (sorry it’s not OnMouseClick) the actual method name is: OnMouseUpAsButton! :slight_smile: lol
As for raycasting, maybe put the billboard 2d images on a layer of their own and make a raycast from the mouse position, looking only on that layer.