- Home /
Question by
Kontor987 · Mar 08, 2015 at 08:11 AM ·
raycastpickuppick uppick up object
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.
Comment
Answer by ifisch · Mar 08, 2015 at 09:18 AM
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.
Your answer
![](https://koobas.hobune.stream/wayback/20220613185311im_/https://answers.unity.com/themes/thub/images/avi.jpg)