A condition to check object distance to a position

There’s an expression to check the distance between an object to a position.

but there’s not a condition…

While you can put the expression in a compare 2 numbers condition. The issue is the compare conditions don’t pick objects.

The only workarounds seem to be to either use a dummy test object or use the compare numbers condition inside a for each object. Neither option is as perfect as using a single compare object to X, Y condition.

Would it be better if number expressions did pick objects …or has this already been discussed many times …and it’s never going to happen

Is a new function (to create) should resolve this problem? (cf. distance between 2 objects)

If yes, i can try to do that.

By parameter, we can imagine to transmit the value of CenterX() of the second object.

Then it must be possible to calculate the ditance between the two objects, that is to say I imagine this like that.

Yes, it would be nice if the compare number and text also picked the relevant objects. I’m not sure if that has been suggested.

The only issue I can think of is that the compare conditions can evolve several objects and it might be tough to know which objects to pick. It’s normally the object on the left but some conditions like collisions pick both object.

Usually, the only time I would use the compare conditions if there wasn’t a regular condition or you need to use a formula on both sides.

Possible without dummy

Or is your goal to run it as cross check?
Like not only check if player distance to each ball is below something

But if i would have 2 players there to run it individually for any player
So if i have 5 ballz on left and there is player 1 and 5 ballz on right and there is player 2

And both of them are in range of less than 40 pixels from 2 ballz on their sides

Then only these 2 balls on their sides would get green?

I guess I usually use compare numbers when using abs() for forces and object variables…and I’m already referring to the object or using repeat for each