• 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
0
Question by EClancy · Dec 10, 2014 at 09:16 AM · 2djavascriptcollisiongameobjectcollider

Unity 2D Colliders not Colliding

I have a ring of fire that I would like to melt ice on the ground. The colliders just don't seem to register each other. Why won't the colliders work? (They successfully register the player)

Here's the scene with the ice patch's collider

alt text

And here's the scene with the ring of fire's collider

alt text

Here are the objects in the Hierarchy

alt text

And here is the Javascript on the ringOfFire

 var burnDuration = 6.0;
 var damagePerTick = 3.0;
 
 
 
 function OnTriggerStay2D( coll : Collider2D) {
 
     Debug.Log(coll.gameObject.name);
     if (coll.gameObject.transform.root.tag == "Player"){
         var args = new Array ();
         args.Push (burnDuration);
         args.Push (damagePerTick);
         coll.transform.root.SendMessage("setFire", args);
         
     }
     if (coll.gameObject.name == "icePatch(Clone)"){
         Destroy(coll.gameObject);
         Debug.Log("Melted Ice");
     }
 }




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
1
Best Answer

Answer by EClancy · Dec 11, 2014 at 01:03 AM

I figured it out so I'll post it here - turns out edge colliders cannot collide with each other. I used polygon colliders instead, and this solved my problem.

Comment
Add comment · 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
2

Answer by HarshadK · Dec 10, 2014 at 07:00 AM

Put a Rigidbody2D component on your ringOfFire game object.

Comment
Add comment · Show 1 · 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 EClancy · Dec 10, 2014 at 09:29 PM 0
Share

I've now added this to both objects, but I see no results.

alt text

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

2 People are following this question.

avatar image avatar image

Related Questions

Collision with renderer.enabled? 0 Answers

OnCollisionEnter Collision not detected? 1 Answer

OnCollisionEnter2D not working? 2 Answers

How do I get the player and the object they touch both disappear/destroyed? 1 Answer

Different results between "ContactPoint" and "ContactPoint2D" 0 Answers

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