On Thursday I started on the thing I was the most excited about adding: the fetch quest! To start with, I needed to create the pickups: a berry and a fish. I went into photoshop and I repurposed my fish texture, then painted a lingonberry for the UI. I then followed
this tutorial in making the widget for them as well as a blueprint. Following this tutorial however, I came across a hitch: I didn't want to click on the actors, I wanted to press a key on the keyboard (E). To solve this, I decided to add
this tutorial to the mix.
 |
My incredibly empty looking inventory widget |
 |
The inventory widget graph that adds a texture into the box. I edited it from the original tutorial so that it wipes the previous one first though, as I wanted the player to exchange the berry for the fish, not have them both at the same time. |
 |
The item widget! Once again looking very empty |
 |
In the event graph though, the texture can be set using an index and an array of textures, so the icon shown in the UI will depend on the item being picked up. |
 |
Actor blueprint: On play, the text widget is hidden as the player cannot interact with the item immediately. When it is visible though, it will rotate towards the camera at all angles so that it can always be read. It also has a world offset so no matter what rotation the mesh is at, the text will always float a certain distance above it. |
 |
Here it gets a bit complicated, and starts to mix in with the work I did the day after. On overlap, it checks whether or not the player has already destroyed one of the items (identified by index), if so, it moves onto the next one and if not it checks to see if it can be interacted with yet. From there, it sets another boolean of interactivity and sets the visibility of the widget to on. If all of this isn't the case, the visibility of the widget and the interactivity will be set to off, which is the same for end overlap. |
 |
Widget and collision added to mesh |
 |
'Press E To Interact' widget to be displayed above the mesh |
No comments:
Post a Comment