How do I select an object with extreme pinpoint accuracy?

Hi guys,

In this game, you can select characters and do various things to them

Say I have the below characters

I want to select the dog that is behind them. Is there a way to do this?

I’m using the point inside objects condition, image but since Gdevelop uses the collision mask to check, it doesn’t work as I want. (Since collision masks cannot match the exact shape of the image).

This results in the player selecting all characters instead of only the dog.

You can edit collision mask like change their shape
But also you can add multiple collision masks to same object

You need to keep your maks convex

But you can build some shapes from multiple collision masks
Where you don’t need to be ultra accurate

I would go with

So as you see some part of dog collision mask is still able to be selected

BUT in case you are talking about different issue where you want to actually kick on multiple objects but pick only one

You could simply in add to it condition
Pick nearest object to CursorX() CursorY()

1 Like

Great reply, thank you!

I Totally forgot that we can have more than 1 collision mask!!
This is a pain to implement with animations, so I did your second solution and the accuracy now is almost perfect. Well, good enough for a Game Jam game :smiley:

1 Like

If the object’s are in a group, then you might also be able to use the pick nearest object from the Cursor X and Y.

1 Like