collisions for instanced scenes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sakura37

For my brick breaker game, I put all the bricks in a node. Every brick is the same scene, I just did a drag & drop .

For a super power, my ball should be able to destroy any brick without colliding(like a super ball). The problem is that even though I disable the collision for every brick, it is still colliding. The script doesn’t work (when I did a print for collisionshape2d, it said that it isn’t disabled.

I tried multiple approaches:

  • since my bricks are all in a group, I tried to iterate through every brick and disable the collision. It didn’t work
  • I tried to attach a script to the scene and add a function named “collision”. Then iterate again like the last time and stop the collision. It didn’t work.
  • I tried with are2D. It is a little complicated, I didn’t manage (last time I managed something changed in code and it ruined everything. maybe I will do a different post about it)

I think with the signals I will have the same result. Do you know how can I do it ?

maybe you could try having an area2d on your ball in a different layer then move the bricks to that layer so the area could enter and make the bricks destruct and the collision would not occur?

ArthurER | 2020-10-08 23:11