Dynamically Displaying Interact and Hacking Text
Problem:
While doing playtesting for Shutdown, we consistently heard feedback regarding not knowing what the player could and could not interact with/Hack. In pursuit of giving the player more feedback, I decided to dynamically display the Keybind to do these actions when the player is looking at the objects that can be hacked and interacted with. Due to both of these systems being abstracted out as components in C++, this became a little more complicated then just using blueprints. Our interact system was currently only checking if you were looking at an interactable when the player pressed E. This would not work for wanting to dynamically update whether the key shows up or not.
Solution:
To Solve this issue in our interactable system, I decided to write a new function in C++ that was called using unreals Timer Manager system on begin play. To learn about how to achieve this, I used this website below from tomLooman.com to set up the syntax to call my function to check for interactables.
https://www.tomlooman.com/unreal-engine-cpp-timers/
After reading the blogpost, I began working on my implementation for the function the timer would be calling. This function would be doing a linetrace and checking if the hit result was a child of our baseInteractable class. If it was a child, I set a pointer to the current interactable and see a blueprint visible boolean to true saying an interactable was found. If it was not found, I set this bool to false and set the current interactable to nullptr. My function can be seen below,
Using this information on whether an interactable was found or not, I used Tick in our ShutdownCharacter blueprint to display the text above the players reticle.
Fortunately, Our hacking system already had the needed booleans and checks in place so Setting the same system up for hackables was easy to do.
The Placeholder graphic results can be seen below,
- Christian Ortiz (VECCA)
Shutdown
Status | Released |
Authors | TheSenate2002, ekicks0, Vrixic, CameronEuston, Boomishhe, mditcharo |
Genre | Puzzle, Adventure |
Tags | First-Person, Singleplayer |
Languages | English |
More posts
- The FinallyApr 27, 2023
- Post Mortem VideoApr 27, 2023
- Fixing issue with Hud not being validApr 27, 2023
- Finalization of GameplayApr 27, 2023
- Circuit Puzzle ChangesApr 27, 2023
- Touching Up SoundsApr 22, 2023
- Level MusicApr 22, 2023
- Getting people to play the gameApr 21, 2023
- Tuning the Lighting in Level 3Apr 21, 2023
- Static Mesh Mass ScaleApr 21, 2023
Leave a comment
Log in with itch.io to leave a comment.