Help with making a circle outline with collisions

Godot Version: 4.5.1

How would I make a MeshInstance2D and a CollisionShape2D (or CollisionPolygon2D) be the outline of a circle and not the full circle? There could be a possibility for the MeshInstance2D using a torus, but I’m stumped with doing it on a collision shape/polygon.

I’m trying to avoid having to make the many points of a circle outline manually in a polygon (this object is going to be really big), so an option with minimal to no points would be preferred.

Thanks!

Describe the actual use case.

A 2D marble race physics simulation, sorry for leaving that out in the original post.

So what does the big circle represent, a track? What kind of shapes need to collide with it, circles only?

Yes, only other circles need to collide with it. The marble race is in one big circle, with the circle outline I am talking about being the walls so the marbles stay in the circle.

You can just check the distance from the circle.

I see, I’ll try that next time I get on my PC. Thanks!

And also about the MeshInstance2D, I’m going to try to make a png/svg instead, and use that with a Sprite2D as a replacement.

You don’t really need one mesh/sprite, especially if only a small part is visible at a time. You can split it in many parts.

Thanks for all the suggestions!

I eventually decided on my own solution, which is making an SVG with what I want, and importing it with a high scale so the final rasterized image isn’t blurry when it’s scaled.

For the collisions, I ended up just using a lot of CollisionShape2Ds with a Rectangle shape (yes I know it’s what i was initially trying to avoid, but it’s fine if the hitbox isn’t the exact shape of the circle outline)