1 Attachment(s)
Get distance to closest left-side Box
Hi
I have a horizontal row of Boxes ( Active Objects ).
Boxes hotspot is centered.
The Boxes 'collectively' move back and forth horizontally.
Above the row of Boxes there is a fixed Arrow ( Active Object ), defining a X coordinate.
Problem:
I need to get the distace between the Arrow and the 'closest left-side Box' ( the closest box on the left side of the Arrow ).
I need this wtithout any loops.
Idea:
As the 'general offset' of all the boxes relative to the Arrow are the same, i think i should be able to referrance any of the Boxes to retrieve desired data by using 'modulus' in some way.
I have ben trying for a while now but cant seem to wrap my head arround how this can be done.
The problems appears simple enough, but i cant solve it. Maybe im too entrenched into this problem to see an apparent simple solution.
How can i get the distace between the Arrow and the 'closest left-side Box', without any looping?