Function Executes Even When It's Not Supposed To?

Hey community :slight_smile:

So I have this trace function for my character for interaction and the function runs even when the trace is false even though it’s not supposed to. Outside the function it only goes straight to an interface message to the “trace hit actor” and I don’t save the hit actor anywhere. Here is the function:

Here is an example of the situation. In the first picture the trace actually hits the door and interacts like its supposed to. In the second picture I am away from the door and the trace hit is false, but it still interacts with the door. Here are the pictures:


I have checked the hitboxes of the door and the length of the trace, it’s not one of those. Also the trace works as it’s supposed to otherwise.

Thanks :slight_smile:

Understand that the exec pin outside the function always fires, even if you don’t have logic going to a return node. Outside the function, either (a) return a bool of if there was a hit, or (b) check if the hit actor & component are valid.

1 Like

Oh really? Hmm, okay :thinking: Is that a thing that happens exclusively with functions and not with macros or other such things? I didn’t realize that before

Yeah, functions always fire the exec pin so it can run the next node after it; macros don’t. Also, functions can only have one exec pin, whereas macros can have multiple.

1 Like

Yeah I kinda knew the other differences between macros and functions but not the continuous exec on functions. Thanks for enlightening me :slight_smile:

1 Like