Thank you for your assistance. Regarding the subject matter, I’m quite troubled about whether to continue implementing it as is, considering the load and scalability, and have posted about it on the Forum. Below is the specific content.
Overview
In Resident Evil 7 and 8, when you approach an interactable item, an icon like the one below is displayed. (Hereafter, this icon will be referred to as the “emphasis display”)
I’m currently struggling to implement this in my own game.
What I’ve Tried
① Using a Collision in the item’s BP to do it nicely
After various in-game trials, I first assumed the following specification:
Emphasize when the player overlaps with the emphasis displayable range and is within a viewable/angle that allows for emphasis display
To implement this feature, I created a BP with a SphereCollisionComponent (hereafter, ItemBP) and implemented it as follows:
- When a Player overlaps with the SphereCollision of ItemBP, it passes its own reference to the PlayerController through an interface.
- The PlayerController stores the received reference in an array of emphasis displayable items.
- The PlayerController retrieves the view, and when an emphasis displayable item enters a specific range of view, it notifies the respective ItemBP through an interface.
- The notified ItemBP sends a start animation notification to the set emphasis display Widget through an interface and sets its visibility to true.
With this setup, emphasis display is possible, but icons are displayed even when there’s a wall between the item and the player.
Therefore, to prevent this, it became necessary to add a specification where actors in the emphasis displayable item array are connected with a LineTrace, and if there’s a wall in between, the item is not emphasized.
② Using MultiTrace
Given the background of ①, I started wondering how others implement this and did some research, but I couldn’t find many people implementing the exact same requirements.
However, I found this video and learned about MultiTrace for the first time. At first glance, it seemed like it could be implemented easily, but I felt it would be cumbersome for cases where I wanted to change the range for each item.
Question
In the situation described above, I think I can meet the requirements by adding bits and pieces to either ① or ②, but with the emergence of MultiTrace, a function I’m hearing about for the first time, I’m constantly wondering if there’s a smarter way. There’s a saying, ‘If it works, that’s the right answer,’ but I would appreciate any advice as I’m keen to know a kind of definitive solution.
Working Environment
- Unreal Engine 5.2.1
- Windows"