Download

Help with top down object interaction on click when character is close enough, also object clicked

I’m trying to get object interaction working with an interface component added to the object, and implementing a distance check for the interaction interface to get called. But this was made for a first person camera character, so I switched it from the camera location to the mesh instead, but also, I want it to also check if the object was clicked on, rather than just the character being close enough and facing the object. How do I go about adding both using an InputAction for Left Mouse Click when the character mesh is close enough and facing the object using an interact interface, but also that the object is being clicked on?

This is the tutorial I followed: https://forums.unrealengine.com/community/community-content-tools-and-tutorials/91268-simple-effective-expandable-interaction-system

This is what I have:

For a Top-Down game, you can use the Get Hit Result Under Cursor By Channel node (through a player controller reference) to identify what the mouse cursor is pointing at. If the Hit Actor implements the required Interface, you can then do your normal Line Trace to the front and see if hits the same actor. If yes, both conditions are satisfied: being under the mouse cursor when clicked and directly being in front of the character, and you can proceed to call the Interact function.