How to disable collision between 2 RigidBodies in the same group?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rwrz
:warning: Old Version Published before Godot 3 was released.

I have 2 instances of a RigidBody2D (ball), and I want them to NOT COLLIDE each other.
How can I do that?

:bust_in_silhouette: Reply From: umfk

PhysicsBody2D.add_collision_exception_with(PhysicsBody2D body)

Adds a body to the collision exception list. This list contains bodies that this body will not collide with.

man! you are awesome!

rwrz | 2016-03-03 14:12

there’s also the constant PS2D which does the same thing as typing PhysicsServer2D but is shorter to type.

dc1a0 | 2016-03-03 15:33

Hi frien my problem is both PhysicsBody2D cant be finda cause node not instanced in main root scene. Both are preload scenes? Can you help me?

linuxfree | 2016-08-18 16:17