Can we extrude 2D polygon shape, to get a 'donut-like' polygon?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Geoffrey Mégardon
:warning: Old Version Published before Godot 3 was released.


I am starting to prototype a game in which the players will be moving inside a circular arena, and so I was wondering if I could make a ring/donut-like polygon to model the collision of the arena’s wall.

Alternatively, is there a way to extrude a 2D polygon?

Thank you,

You can make a circular area and prevent the players exiting that area

eons | 2016-10-23 18:49

:bust_in_silhouette: Reply From: Zylann

If your game is 2D, then I don’t think you need to extrude a CollisionPolygon. All you need to do is to make it circular.
If your game is 3D, then you can extrude, but not in Godot. You can make a mesh in Blender (create a circle then extrude it), import it and use it as a collision mesh in your scene, maybe?
I’m not experienced with the 3D side of Godot, I see you can create collision shapes (there is ConcaveShape in CollisionShape), but I don’t see how you would create a collision mesh. It has probably been “hidden” in the 3D scene import workflow.

I think it is actually useful to be able to make ring-shape in 2D and complex shape with holes.
But maybe that will come with the mesh 2d that will be implemented for Godot 3.0.

Note that he Polygon2D node allows to invert the polygon, so that if it was a circle, you get a square with a hole.
Polygon2D — Godot Engine (stable) documentation in English

That functionality however is not present in CollisionPolygon2D:
CollisionPolygon2D — Godot Engine (stable) documentation in English

Geoffrey Mégardon | 2016-10-27 13:12