CollisionShape2D or CollisionPolygon2D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By golpebaixo

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.

A bit late, but I was wondering this also, then I went and read the documentation: CollisionPolygon2D — Godot Engine latest documentation

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

chiara_jm | 2020-04-20 15:05

:bust_in_silhouette: Reply From: shmellyorc

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