I need help To build a script

well, i want to build a script but i dnt know how to write that. here is wht i want.
I want that when my camera see a specific object, it needs to show the height of the specific point from the reference point on the terrain and show that data on a GUI.
thnx

I suppose that you could use a raycast with a layermask to detect only the specified object. Then use the RaycastHit information about the object, namely the position and scale, to determine the information you want. As for displaying it on the screen you can use GUI TEXT. There are lots of video tutorials on youtube and other websites that can help you with that, and they do it better then I can with text alone. I will give a quick rundown just to get you started. You can create a GUIText by going to the GameOject tab then to create other → GUI Text. You can then reference this in a script and make it say whatever you want in this case the height of your object.