• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by pikasso · Nov 15, 2014 at 04:11 PM · 2dcollision

No Collision with Edge Collider 2D

Hi,

I'm trying to do a simple space shooter and I want the different ships to collide with each other. The ships are sprites. For this I wanted to use an edge collider on the ships. But the ships don't collide with each other. Neither the rigidbody2d reacts, nor does the OnCollisionEnter2D function run. If I shoot at them, the bullets collide just fine. But the bullets have Circle-Colliders. If I use box colliders instead of edge colliders it works fine with the ships too.

I've already tried setting the collision detection to "Continuous" but that didn't help. My scale is at 1, so I think that shouldn't be a problem either.

I'm using Unity 4.6, but I don't think it has something to do with the beta.

Do you have any suggestions?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
15
Best Answer

Answer by Pyrian · Nov 16, 2014 at 05:13 PM

Edge colliders do not collide with each other. Straight from the Box2D manual (Unity 2D physics uses Box2D):

"A major limitation of edge shapes is that they can collide with circles and polygons but not with themselves. The collision algorithms used by Box2D require that at least one of two colliding shapes have volume. Edge shapes have no volume, so edge-edge collision is not possible."

link text

Maybe convert them into Polygon2D colliders.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image pikasso · Nov 19, 2014 at 05:09 AM 0
Share

Thank you for your answer. Yeah I suppose I'll have to do it with the Polygon2D, then. Edge colliders seemed just more convenient.

avatar image daviddickball · Sep 06, 2015 at 10:02 AM 0
Share

Thanks for this answer, as this caught me out. How bizarre that they can't collide with each other! I didn't expect that!

avatar image ozcomingfroo_unity · May 31, 2019 at 10:59 AM 0
Share

That's flash news for me. I just in the exact same issue as this OP.

Really sucks to be honest.

It's a painful technical issue

avatar image
0

Answer by MrBishLasgna · Dec 27, 2019 at 11:31 AM

IF you need the other edge collider just put a simple box or circle or any other collider just inside of the edge collider so the edger collider can perform its functions with any other collider and the box can perform its functions with edge... I know im a little late XD but at least I can help other people who come across this.,I had the same problem but if want to put a box collider or other colliders just inside of the edge collider so you can keep your edge collider if you need it for other things

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image isac_cab · Feb 09, 2020 at 10:53 AM 0
Share

Hi man! i am new to unity, so how can I do this?, how to put another collider inside fo the edge collider?

avatar image unity_tTGzzGUBU53E9w · Jun 30, 2020 at 09:12 AM 0
Share

@$$anonymous$$rBishLasgna can you tell me how to implement this solution?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

No Collision in 2d Scene 0 Answers

Changing from trigger to collider after exit in 2D? 1 Answer

Collision problem 0 Answers

Destroy object on touch of object with specific class 3 Answers

Size and Position of BoxCollider 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges