0 votes

Hello,

I'm creating a simple match 3 type game, and I have created a grid of blocks. Each block is an Area2D node with a CollisionShape2D (rectangle) that perfectly fits the artwork. Block is 32x32 pixels and the collision node has extents of 16x16 pixels. Pixel snap is on in the settings, but this also occurs if it is off.

The blocks are placed programatically and are positioned perfectly next to each other with no separation. I've connected the_input_event signal on every block to a function _on_block_input_event which handles the input processing.

However, sometimes, if I click on the boundary between two blocks, no event happens. It's like there is a gap between the blocks, even though there isn't. I've even turned on visible collision shapes to look for gaps, but the alignment appears perfect.

Has anyone else come across this? Or maybe has some thoughts about how this might happen? Thanks :)

in Engine by (366 points)

Go to you block scene and make sure the collisions shape scale is 1 on X and Y, it MUST be one, you should not scale collision shapes otherwise you gonna get weird bugs.

Thanks for the reply. Yeah I never touch the collision scaling for that exact reason. I've just double checked and all scales are set to 1.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.