0
\$\begingroup\$

I have 3 circles (2D) they all have circleCollider2D. what I want is to make a collider that make border around them. I can't express which type of collider I need, so I put example image below. Red lines are the collider I want.
enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ A collider won't create a visible border. Do you want a visible border, or do you want a collider? Try explaining how you're using this in your game - how should the player interact with it - as this can help clear up any ambiguities. \$\endgroup\$
    – DMGregory
    Sep 17 at 17:04
1
\$\begingroup\$

Check out the PolygonCollider2D. It allows you to create a collider with any shape you want.

Another option which is less flexible but might be more performant in your particular case could be to create a CompositeCollider2D and a Rigidbody2D and then create three child game-objects, each one with a BoxCollider with "Used by Composite" enabled.

Update by Rashad: I used Polygon collider to solve the problem. You can see image below enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ It worked. I did know that how polygon collider works. but I didn't think that I can use it the way I want. Thank you man. I add photo to your answer. I used it now. Thank you \$\endgroup\$ Sep 17 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.