Topic was automatically imported from the old Question2Answer platform.
Asked By
jujumumu
For my staticbody I have 2 collisionshape2d and when I instance the scene at the same place it causes lag because having to many collisionshape2ds in 1 place leads to a lot of collision pairs. Having 150 instances leads to 45000 collision pairs and the fps decreases to single digits. How can I make the Collisionshape2d 1 and Collisionshape2d 2 not collide which will decrease the number of collision pairs by a lot.
Depending on your setup, you could use collision layers. Most of the time this will work. Just set each to be on a different layer, and make sure you have the things it should collide with on that same layer as well.
Collisionshape2d 1 should not collide with Collisionshape2d 2. Collisionshape2d 1 should not collide with itself. Collisionshape2d 2 should not collide with itself. And then I have the player which should collide with Collisionshape2d 2 but not Collisionshape2d 1. I have doubts to this solution because I already set the layers so that Collisionshape2d 1 does not collide but they still have collision pairs.
jujumumu | 2019-08-14 04:33
Could you tell me what layer each object is on?
andersmmg | 2019-08-14 04:43
Looking further I do not think you can change the layers for collisionshape2d only for the staticbody so there is no way to make some collisionshape2d not collide. There still might be??