[SOLVED] Pick only one object?

I have 4 objects

If hovered it shows an outline

What I want:
Only apply this effect to only the nearest one according to cursor position

Actual result:
When hovering on 2 objects, if those object are placed nearby it’ll show 2 effects of outline


This is my event

Any clues?
Thank you.

If the Lands are all different and not the same object then you can do this.
For each object land:
Cursor is on land+Effect on all lands is off=Turn on effect outline on land.

or if not then use the for each object

The issue is it’s picking the nearest object which works but it’s only clearing the object when it isn’t in collision.

You can try using point is inside instead of the collision conditions. Either set the origin to the tip or use a custom point.

Unless the objects are overlapping the point can’t be in more than one object.

Another option is to shrink the hit box to just the tip. And space the tile or their hit boxes so it’s impossible for the cursor to collide with 2 objects simultaneously.

Edit: as stated by Phoenix (inverted) Cursor is on land should also work

Thank you guys, it works now!

1 Like