Can you make a hollow circle for a CollisionShape2D?

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

I could attach a bunch of CollisionShapes together to imitate a hollow sphere but I’m instancing this thing at least a hundred times so I’d like to keep it to a minimum.

(In case its important, this is for an Area2D)

:bust_in_silhouette: Reply From: Thomas Karcher

You could draw a polygon shaped like this:

(With the edges better aligned than in this rough sketch)

Ok I’ll try that!

Do you know where the tool is to draw the lines? There aren’t any options for it on the toolbar like with Path2D…

MIna | 2020-09-17 18:16

It would be easiest to

  1. Draw the image with an external image editor (or use hollow_circle.png - Google Drive )
  2. Import it in your project as Sprite node
  3. Select the sprite
  4. In the top toolbar, open the “Sprite” menu
  5. Create CollisionPolygon2D from Sprite

Thomas Karcher | 2020-09-17 18:44

I see. Thank you very much for your response.

MIna | 2020-09-17 18:59