(Solved) How does touching an object affect collision masks?

Hello.
I am making a mole game.
Whack a mole game is scoring points for touching the mole, and touching the hole under the mole is also considered a success. If I apply a collision mask to the mole only, will only that part count as a touch?

Change collision mask to 1x1 square
And check can you touch it

You can launch preview of your game in your phone browser to test touch controls

Or use NOX player or LTPlayer or BlueStacsk which are android emulators

1 Like

In my testing, collision masks don’t seem to affect finger touch. Touching areas outside of the collision mask will still be scored the same.

Please show your code, it makes things really easier for us to point out what you’re doing incorrectly and help you with future mistakes.

1 Like

Then i would assume it works on is it inside object

You could add to your button button state behavior
And check in condition is it pressed

Maybe that would affect collision mask
IF NOT

Then for your game i would place separate object on moles called collider or CollisionChecker
And check if that is pressed
Object could be invisible like with opacity 0
And it would work as your fake collision mask

2 Likes

Just for clarity. The cursor/touch is on condition uses the bounding box while the point is inside condition uses the collision mask.

When it doubt, experiment.
The left uses cursor/touch is on while the right side point is inside

I used these events to draw a circle depending on the condition type.

Make sure the collision mask is convex.
The circled dot is bad. Nodes can’t be concave.

1 Like

Now that makes sense. Thank you, everyone.

1 Like