Multi Line Trace for Objects that checks tags only once

Hello folks! I need your help. I’m very noobish in UE so if you’ll know the answers please explain as detailed as possible, thank you very much!

I create a system that requires a Multi Line Trace for Objects. How it looks: Multitrace with tags posted by BelNuts | blueprintUE | PasteBin For Unreal Engine

It hits all world static objects and if it has tag “Wall”, it counts the distance to this tagged wall. The problems start when it hits through 2 or more walls because the trace counts the distance twice or more and writes two floats to one variable but I need only the first hit with tag “Wall” to write to variable. Any chance to make it in blueprints? Note: I can’t delete tag checking, it’s a constant condition for my system.

Or to set only the first hit with “wall” tag
Or the smallest of these measurements
Or repeat the measurements until it reaches the first “wall” object then stop

That’s how I imagine it could be logically resolved, thanks again!

1 Like

P.S. I guess I resolved this issue by adding “Do Once” node after “branch node” and before “Set”. And added “Delay” node after “Print String”, connected “completed” on “Delay” to “Reset” on “Do Once”.

But anyway if you know better solutions I will be happy to know it!

Change this

image

to

image

1 Like

@ClockworkOcean Thank you very much, it’s good too!

1 Like

With a DoOnce, you still process the whole list. So, this is slightly more efficient :wink:

1 Like

Got it, thank you for the explanation! :pray:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.