Godot Version
4.4
Question
How would I go about inverting a CollisionShape2d?
I’m trying to make googly eyes and I want to use the CircleShape as the max radius it can go. I just don’t know how I would go about making it something my object can sit in. Let me know if more details are needed.
Hi!
I don’t think there’s any way of inverting a collision shape (for performance reason, as concave shapes are way more expensive to handle than primitive shapes like circles, rectangles, etc.).
You could try by using a polygon that is kind of a circle, but with a tiny gap so that it will surround your eye (the gap being too small for the eye to go through), or multiple rectangles that you rotate around.
Anyway, for what you’re trying to do, you don’t need a totally accurate circle, so don’t be afraid of using a solution that’s not perfect, but makes the googly eye look cool 
Is there a specific reason you want to use a collision shape for this?
Personally, I would query the circle the googly eyes are in and use that information to define the area the googly eyes can move around.
honestly i’m rather new at godot and I was just thinking about what actions i wanted it to take. how would I use the information from the circle to define the area? right now i’ve been trying to use distance from starting point to radius with:
if distance > radius:
I’m currently using the eye as a character I can control to atleast try and get an edge for it where the character stops unless is going in a different direction but wow am I having a difficult time with it lol.
thank you for the help!
It looks like you are already using the relevant information about the circle to limit how far the googly bit travels.
This just occurred to me while replying - you could attach the moving part to the center with a spring.