VIRTUOS_Docs/sites/codesnippets/Inventory.qmd
2026-01-07 22:07:11 +01:00

13 lines
No EOL
965 B
Text

---
title: "Inventory"
---
The Inventory uses a scalable, circular array of widget components the user can put objects in and draw objects out. When the inventory is opened, the player moves their hand towards a widget, which then gets activated. Depending of the content of the widget and content of the hand, an action (put in, pull out, replace) is triggered on inventory close. Compared to [approaches based on a line trace/widget interactor](https://www.youtube.com/watch?v=YE0sfJyraws), I use the distance to the hand for a quicker and "sloppier" interaction.
Item Data is handled via an Item Data Component, following the guidance of [Ryan Laleys Inventory System Tutorial Series](https://www.youtube.com/watch?v=vHT4MhmwacE&list=PL4G2bSPE_8umjCYXbq0v5IoV-Wi_WAxC3&index=1). The Item Data is drawn from a Data Table.
```{=html}
<iframe width="100%" height="500" src="https://blueprintue.com/render/-azlwrm2/" scrolling="no" allowfullscreen></iframe>
```