0 votes

Is there any difference in performance between CollisionShape2D and CollisionPolygon2D?

It's much easier to draw an irregular collision shape with CollisionPolygon2D on the editor (like for adding collision to tiles used for slanted terrain) so I really would like to know if there's any advantage of using CollisionShape2D (and adding the points' positions manually) in such cases.

in Engine by (34 points)

A bit late, but I was wondering this also, then I went and read the documentation: https://docs.huihoo.com/godotengine/godot-docs/godot/classes/class_collisionpolygon2d.html

Editor-only class. This is not present when running the game. It’s used in the editor to properly edit and position collision shapes in CollisionObject2D. This is not accessible from regular code. This class is for editing custom shape polygons.

So, a CollisionPolygon2D will compile to different CollisionShapes2D

1 Answer

0 votes

i use CollisionPolygon2D for complicated shapes for main characters or bosses.
i use CollisionShape2D for simple generic/misc objects.

by (109 points)
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 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.