Finding which object was clicked

Hi, I am experimenting with unity and building up a testing area by adding things that may be useful in future games. I just finished an A* pathfinder that works on 3d terrain and several other basic movement functions.

I am working on an inventory but I cannot seem to find out how to figure out which object I clicked on in 3d space. Is there a good way to do this? I already know how to convert a screen click to a point in world space, it is identifying which object is struck by a raycast that I need help with.

Thanks,
Lopuz3

The RaycastHit object returned by the raycast has a field that contains the transform of the object that was hit. You can compare this with a known transform to see if they are the same object or use the transform’s name for identification.