Devlog #5: Interaction outline and prompt


Hello!

I'm Jacob Waugh, and for this week's devlog, I'd though I'd talk about a new feature I've been working on implementing recently

Player feedback is important, and for our game we thought it would be nice to have a system to show the player what objects they can interact with and how.

I started with the item outline. I'll admit, I don't have much experience with shaders, so this was definitely a learning experience for me. I currently have in place a simple masked overlay that uses the object's vertices and pushes them out to make the outline. While this works fine for round objects, object with sharper corners don't work as well. This is definitely something to come back to, and I know how I would remake it, but for now, it is fine.

For the key prompt, I wanted to make so the interact button shown changes to be whatever the keybind is set to, in case the player changes it. Getting which key is set to which input action is harder than I realized, though. I ended up needing to go through each input action in order to compare it to the interact action before checking for their key and setting the text. While this is somewhat tedious, I can use this same system to get the key for other input actions if those are ever needed for future UI systems.

Now that I had the assets, it was time to create the system to use them.

When the player is in range of an interactable object and it looking at it, it adds the overlay material to the object and makes the interact prompt visible. When the player stops looking at the object or leaves the range, it removes the overlay and makes the prompt invisible.

As with all code, there are some bugs to work out, but for the most part it looks pretty good!There is still work to be done on the shader to make it work for every object, as well as make it fit better into the game thematically. The visuals for the popup could use some refinement as well, but overall a good learning experience for multiple different aspects of Unreal, and I will likely use what I learned here to make it even better!

Talk to you again later,

-Jacob Waugh

Leave a comment

Log in with itch.io to leave a comment.