+3 votes

I have recently come to Godot after using Unity and am trying to get to grips with the 2D nodes. Can someone explain to me the difference between the Area2D and the CollisionShape2D nodes? In my head they, both do the same thing and I don't have a clear understanding of what makes them different.

Thanks

in Engine by (109 points)

1 Answer

+1 vote
Best answer

A collision shape is only a shape. It doesn't do anything other than define an enclosed region. An Area2D is one of the CollisionObject2D types - things that can detect collisions.

When you add an Area2D, it doesn't have a shape. Is it round, square, etc.? The CollisionShape2D lets you define that. Its name comes from the fact that it's a shape which is added to collision objects.

I recommend you read this to get an understanding of the various collision and physics nodes:
http://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html

by (21,313 points)
selected by

I know it has been a while since the question was asked/answered. But my answer is that where Unity uses a simple checkbox for "is trigger" Godot uses an entirely different object.

Area2D is equivalent to an "is trigger" Collider2D in Unity.
CollisionShape2D is equivalent to a regular Collider2D in Unity.

-Mal

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 webmaster@godotengine.org with your username.