Summary: This is how the interface tunnels the functions sequence through the Interact Input Action:
• Updating the counter by implementing Interact function in the player character node, adding #1 to the CollectedItems variable
• Destroying the collected Actor from inside Interact Action's implementation in the pickup node, and
• Unlocking the Exit Gates by updating the MissionAccomplished boolean variable, in case the number of CollectedItems = TotalItems' value.
These are the C++ methods:
• Writing the interface header
• Mapping the interface to “E” key
• Creating an additional capsule
• Writing methods for overlapping
• Setting up a variable for the pickups
• Implementing overlapping in constructor
• The “E” key function, and
• Writing a link to the interface on the pickup node
If you want to take a closer look at the gameplay mechanics, please check out these workflow breakdowns:
Programming Interaction: https://www.3dartviz.com/skills/skills-tech/programming-video-game-interaction-cpp.html
Delegates for UI & Gameplay: https://www.3dartviz.com/skills/skills-tech/delegates-communicate-ui-gameplay.html
Adding Input Action in C++: https://www.3dartviz.com/skills/skills-tech/adding-input-action-cpp-ue.html
Programming Gameplay in C++: https://www.3dartviz.com/skills/skills-tech/programming-gameplay-cpp-ue.html