Pick up item

Hello, i want to make script that when you look at item (sword e.g) then will “press e to pick up” GUI box popup and when you press E it will destroy item you looking at and ad copy of it to your hand/inventory. I tryed to make it with Raycast but the collider box was small and Raycast ray wont hit objects collider.

Please help me, i tried a lot but everything seems to be failure.

*Sorry for grammar.

Look at the layermask of your raycast. Make sure it collides with the proper layer of your item.

Also, make sure the raycast doesn’t start INSIDE your item’s collider.