How to avoid redundant line traces?

I currently have a basic set up for detecting interactable actors using Line Trace By Channel hooked up to my IA_Interact key.

I have essentially the exact same line trace set up to enable a crosshair that fades in/out over an interactable actor.

Seems like a whole lotta line traces. How can I rework this so both are using the same line trace? Or is there a better way to implement this entirely?

Thank you!

To have one trace running every frame to detect interactables, and a one-off extra trace for the actual interaction, is absolutely fine :slight_smile: That’s how I do it.

It’s just not a good idea to have a lot of actors tracing every frame.

3 Likes

Thank you for your reply! Not sure why I thought it was always double tracing - I even have the debug set up so I see what it’s doing. Little bit of a facepalm there but thank you for clarifying what’s actually happening! :sweat_smile:

1 Like

I have a setup where I use a AI_Interact to do a trace that handles the actual interaction part…open doors, working elevators, picking up items etc.

For the UI aspect I’m using a capsule collision component attached to my FPP camera.

The collision component triggers overlap events on interactable actors (custom collision obj channel and profile).

Here’s the interact trace setup.

1 Like