Highlighting object with new GUI system (4.6+)

Hello,

A few tutorials online are using OnGui() and the legacy GUI system to highlight targeted objects in game. I was just curious (1) if this is still the best way to do this; (2) there is a better way to do this using the new system; and possibly (3) if doing it this way is bad coding practices as the old system is deprecated (idk if this true as well)

Thanks in advance for the answers!

As far as I know, yes the old system is deprecated, however, if you want to use the new UI system, I would suggest trying to create a couple of scripts. One that RayCasts from the camera and then upon clicking will show a “Target Selected” object using a UI element, but this UI element must be set and changed in script to render to the World Space not to the Camera. If this is wrong someone will tell us. But I think that it would be easier to use the OnGUI method, but using the new UI system, would be cheaper and more efficient.