Improve / Issue with drop items to ground

Hello,
I am using the inventory system package from the course,
all works fine, but i want to improve the inventory system, I want to choose the places where the items can be dropped, and not anywhere else other than the containers.

how can i achieve it?
thank you for help!

@Brian_Trotter may be the most helpful here, but you would probably create a new component that inherits from ItemDropper and override the GetDropLocation() method to cast a ray (like we do to determine where to walk) and find the location under the mouse. Then just return that. Replace RandomDropper on the player with this new component and the InventoryDropTarget will use that to place the item where you dragged it.

1 Like

What @bixarrio has described will work perfectly for dragging an item from inventory to the spot where you release it with the mouse.

I noticed, however, that you mentioned containers… You’ll have to be more specific about what you mean on that, as it may require a different solution.

Privacy & Terms