I have children of Actor called BP_Interaction_Master which have a static mesh a collision sphere and a widget component (set to screen and hidden).
When the player get’s within the collision sphere the actor gets added to an array Called Interaction List, and when they leave the collision sphere the actor is removed from the array.
I have been trying to figure out how to take where the camera is looking and sort through the array to find the index of which actor the camera is looking closest to. I have gotten fairly good results, but far from perfect.
Here are my results so far, the system currently doesn’t track which result is best, but the last result that works. I’m not sure how to find which is the best of the successful tests and get it’s index specifically. I’m also not sure how to handle choosing between items that are lined up infront of the player, the system will always choose the item that is closest to the camera rather than closest to where the camera is looking.