top of page

MVVM Inventory Study

Unreal Engine 5 / C++

I wanted to create a study project to learn how the new UMG Viewmodel (MVVM) worked in Unreal Engine, I decided it would be a good idea to use an inventory slot item to test it out. 

Zelda Inventory Project Thumbnail.png

I started by creating a widget that would function as the Inventory item, and I set up the main layout that would be connected to the viewmodel to be updated in run time.  I wanted the inventory slot to look similar to the inventory in The Legend of Zelda: Echoes of Wisdom, that is why I made a quick material to simulate the selected state of the item slot.

Selected Material

Once the layout was complete, I created the viewmodel that was going to be used in C++:

As a final step, I set up the view model in the inventory widget with all its bindings, and setting up its creation type to "Manual". Through a third script that manages all inventory slots, I can assign the corresponding view model to each slot and update their data as needed. When its data is updated, it will automatically update the widget with the correct visuals.

Inventory Slot with VM

Contact Me

Feel free to send me a message to: jrueda03@gmail.com, I'll try to respond as quick as I can! You can also find more about me here:

Icon Linked In.png
GitHub Icon white.png
bottom of page