+2 votes

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

in Engine by (45 points)

1 Answer

+2 votes
Best answer

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.

by (372 points)
selected by
man! you are awesome!
there's also the constant PS2D which does the same thing as typing PhysicsServer2D but is shorter to type.

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?

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 Frequently asked questions and 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 [email protected] with your username.