Closest input filters?

I’m trying not to use proximity for lag. So as a detection I want a way to filter messages to the closest. So that it activates as the closest signal. I was trying to use filters, but it’s too broad.

Not entirely sure what you mean. Do you mean you want to find the closest X from the messages?

Like if there are 5 enemies, and all send an x and y signal. I want the tower target whichever is the closest.

Using the distance equation you can find the distance to each one, then you can filter whichever one is the closest.

To do this, just have the filter set to “Less Than” and have the “Pass” output connect to the “Value” input.
Then just reset that when you’re doing sending messages


Now I’ve realized it sometimes takes the closest X and Y from separate enemies. Not sure how to separate that, but besides that it’s great.

1 Like