0 votes

I am making a breakout,
Thanks to all of your questions, we have reached the point of changing things called contact monitors.
However, even if the ball collides, the block does not disappear.

Briefly explaining the mechanism of the game,
KinematicBody 2D called "Blocks"
It collapses when it collides with RigidBody 2D called "Ball".

func _fixed_process(delta):
    var bodies = get_colliding_bodies()

    for body in bodies:
        if body.is_in_group("Blocks"):
in Engine by (48 points)
edited by


I sorta worked around your problem by adding an area2D to the blocks, and making them a bit bigger than the block itself, while adding a timer mechanic in the script so the block wont disappear before the hit itself...

now no offense man but the organization was kinda hard to read, and a couple of tips, dont put EVERYTHING under a node2D, you can save a rigidbody2d for the player node itself, its actually making it easier to read later on, dont scale collision shapers, as far as i know it suppose to do some problems and try to make the node tree more readable, and use node2D as containers and not kinematicbody2D, hope i helped you out and good luck man

Thank you very much.
The point is that you have to make it wider than the image, do not you think?
As for the question, is it that the group you designate is not the one to do, but the one who collided?

The area2D need to be wider because if not then the ball will wont enter but calculate the position without colliding(godot does that).
The group that i check for is the group i designated for the player itself( aka Player ) so i will know for sure that this is the player and nothing else

..But Since I moved to Godot 3,
can you tell me how to do it with Godot 3?

...What you do is not changed.
Excuse me.

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.