Displaying More Information
- Steven Lee
- May 28, 2021
- 2 min read
Updated: May 30, 2021
During this week of development I was tasked with making the information of items that are spawned after clearing a room. With no experiencing creating and communicating UI, I started the weekend with figuring out how the UI in unreal operates and how its displayed. Once I researched the groundwork, I had to think of how to get the information of both item types, weapons and relics, and what information would be important to display to the player. As requested, a name, description and some keywords with values to show you what they do.
At first I created the UI and linked it with a collider on the spawnable item. Interfacing with the UI was the most difficult part as I needed a reference to the UI which is a abstract object, which is not very well documented in terms of how to communicate with it in C++. I figured out a solution of working backwards from blueprints and then recreating the UI with C++ and linking a reference to the modular UI to the groundItem class.
I decided to store the information of the weapons and relics themselves as opposed to their primary assets as I was having issues with having to either move all the data to primary assets, which were being difficult with sharing information, or just putting the data in separate objects, which if anything changed, would be another place I would have to update information. So I with the data on the weapons and relics respectfully, I was able to transfer that data to the item they were spawned as and that communicated to the information to the UI.
Next step was making the items only be picked up upon specific button press. The F Key and Face Button Up were not bound yet in our game, and these buttons made sense to bind as a interaction button. Once I put that in place, I needed to figure out a way to tell the player there was a valid object in front of them that they could interact with. Once the player is in contact the player, they are notified that they can interact with something and upon the bound keys, the item will apply its effects to the player.
Finally, I hid the meshes used to display items previously, as relic ground items were not as obvious as weapons when just floating in the air. A cone was not a effective Poison Resistance Relic! So using the icons that we had been using for the menu UI, I made the spawnable objects used billboards with those icons to display what they were, so they would be more easily readable from a distance.
This week was a difficult one with the different aspects needed to create item readability, and there are still more features that needed to be added to it to make it feel more alive. At its current state though, items are much more readable to the player and have a clear purpose and are more obvious in what they do!
Comentarios