[ad_1]
Our prompt was to do something related to a new game engine, and I’ve never worked in Unreal at all, so it seemed like a good choice. I did have a little bit of knowledge of C++, so I decided to follow the Blueprint approach, just to make the experience even more of a fresh start.
I decided on the more specific goal of making a functioning inventory system. I started out with some basic steps to make interactable items and pick them up (the bottom section isn’t really used anymore, but it’s what I started out with):
![](http://journalismcore.com/wp-content/uploads/2024/03/Role-Analysis-Project-02-Check-In-First-Steps-in-Unreal-Engine.gif)
This was easier than I expected for never having touched this engine before. Next on the list was having some UI that I could toggle with a key press. I tried a couple different methods for this, but ended up with something like this (activated using Tab):
![](http://journalismcore.com/wp-content/uploads/2024/03/1709314703_89_Role-Analysis-Project-02-Check-In-First-Steps-in-Unreal-Engine.gif)
I used Unreal’s version of the Input Manager to do this, although it says that these specific inputs are deprecated, so this might need changed.
![](http://journalismcore.com/wp-content/uploads/2024/03/1709314703_599_Role-Analysis-Project-02-Check-In-First-Steps-in-Unreal-Engine.png)
![](http://journalismcore.com/wp-content/uploads/2024/03/1709314703_565_Role-Analysis-Project-02-Check-In-First-Steps-in-Unreal-Engine.png)
The hardest part was managing the inventory itself, and then updating the UI accordingly. I had never even made an array in blueprints until now, so it took a lot of tutorials and experimentation. Here’s how I pick up each item and add it to the inventory:
![](http://journalismcore.com/wp-content/uploads/2024/03/1709314703_473_Role-Analysis-Project-02-Check-In-First-Steps-in-Unreal-Engine.png)
This is the Inventory component, which manages the array and calls the UI update:
![](http://journalismcore.com/wp-content/uploads/2024/03/1709314704_669_Role-Analysis-Project-02-Check-In-First-Steps-in-Unreal-Engine.png)
The UI itself looks like this, and then I dynamically add a textbox to the vertical list upon pickup:
![](http://journalismcore.com/wp-content/uploads/2024/03/1709314704_314_Role-Analysis-Project-02-Check-In-First-Steps-in-Unreal-Engine.png)
Here’s a quick look at the end result so far:
![](http://journalismcore.com/wp-content/uploads/2024/03/1709314704_267_Role-Analysis-Project-02-Check-In-First-Steps-in-Unreal-Engine.gif)
The list is preserved when you open/close the UI, and it updates properly regardless of if it’s open or closed. I also have a blueprint to de-activate movement when the inventory is open, but I haven’t enabled it yet.
Final Goals:
I would like to go in the direction of sorting. Having multiple buttons that would re-arrange the inventory in alphabetical, chronological, or some other order would be a fun way to experiment with other sorts of variable interactions within blueprints. Adding delete functionality and some more polish (like images) would also be a nice touch.
[ad_2]
Source link