I’m writing a script that simulates gravity, and I wanted to set the max distance for the gravity to be depending on the Planets mass and scale. I use whatis called a Sphere of influence, so I need to use the radius of the planets. The problem is that in my formula I use CircleCollider2D.radius, but it always returns the same value, no matter how big or small I set the scale for the planet. I can’t seem to figure out how to do this.
EDIT: I have 2 planets, one has double the scale of the other one, but the CircleCollider2D.radius returns 1.41 and 1.5
CircleCollider.radius is the radius property on the CircleCollider. Changing the scale of the GameObject does not change this property, even though the collider changes size in game space. If you change the radius value, you’ll see a change when you read it.
What specifically are you going for here? There’s probably still a way to do it.