0 votes

Hi,

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,

in Engine by (16 points)

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

1 Answer

+2 votes

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.

by (27,897 points)

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.
http://docs.godotengine.org/en/stable/classes/class_polygon2d.html

That functionality however is not present in CollisionPolygon2D:
http://docs.godotengine.org/en/stable/classes/class_collisionpolygon2d.html?highlight=collisionpolygon2d

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.