Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Error with picking up an item...

$
0
0
I have a "for" loop that should give the user an item. I have the inventory scripts set up already, everything in good order. However, I do not know how to add the item to the inventory when the player presses "E" and the mouse cursor is over the item (cursor locked in screen center and cross-hair set up). for(var x = 0; x < loot.length; x++) { Inventory.playerInventory.Add(loot[x]); } Can anyone help me? Do I use OnMouseEnter? Thanks in advance!

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>