Way to trace for a specific component?

I want to trace to a static mesh component within an actor and do something different depending on which component is returned. Is this possible?

Thanks in advance

I tried that but it wouldn’t pass a check comparing it with any of the components. I must have messed it up somewhere; I’ll try again, thanks!

This should be a basic function of any of the traces. just break the hit result open and use the hit component pin (last blue in that list) to control your logic flow.

1 Like

Here is a quick example usage setup. note because everything is currently on the same object some node settings have been modified to allow for self-collision in trace results to occur.
The first one returns a true response (line trace is hitting the box collision). the second one i’ve swapped the location of the sphere collision component and it returns a false.

for ease of use and organization, assuming you are ‘shooting’ a line trace at the target object. I recommend a blueprint interface that upon a successful hit tells that object it was hit, and sends it the hit component in the message. that way the object can decide what needs to be done on its end and can easily compare the passed result with its own components.

Ah, I needed to check “trace complex” on the “get hit result under cursor by channel” node I was using, it had nothing to do with the hit result! Thanks!