Hello Guest

Author Topic: Collider Issue in 4.3  (Read 18640 times)

TheMightyGit

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Collider Issue in 4.3
« Reply #15 on: December 10, 2013, 02:47:05 pm »
I've updated the code for the next version - it should detect this a lot better. Let me know how that goes once its released.

Thank you!

Tiltgames

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Collider Issue in 4.3
« Reply #16 on: December 16, 2013, 05:14:46 pm »
Hi everybody,

seems that the issue is still there. I'm using 2D Toolkit v2.3.3 with Unity 3D v4.3.1f1.
Here is what happens to me:
If I have a sprite with a user defined collider as a prefab, switching the collider to polygon will result in duplicated colliders everytime I hit play. Quick fix: To switch the collider I had to delete the collider from the sprite and then setting the collider to polygon. Or is this normal?

Thanks and best regards

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Collider Issue in 4.3
« Reply #17 on: December 17, 2013, 09:51:14 pm »
If you can definitely reproduce this, please email a repro example to support at unikronsoftware.com - I thought the 4.3.3 update should've put a stop to this and I can't reproduce this any more, but perhaps I've missed something?

kreso22

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Collider Issue in 4.3
« Reply #18 on: March 02, 2015, 05:14:10 am »
This is happening to me too.
I can't make a repro - but I did a fix that works for me. Just attached this script to object containing sprite/colliders

[ExecuteInEditMode]
public class FixBugWPolygonColliders : MonoBehaviour {
void Start () {
      //remove all collider duplicates (tk2d bug)
      PolygonCollider2D[] colls = gameObject.GetComponents<PolygonCollider2D>();
      bool originalCol = false;
      foreach (PolygonCollider2D col in colls)
      {
         if (!originalCol)
         {
            originalCol = true;
         } else
         {
            #if UNITY_EDITOR
            DestroyImmediate (col);
            #else
            Destroy (col);
            #endif
         }
      }
   
   }
}

huminaboz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Collider Issue in 4.3
« Reply #19 on: January 10, 2016, 12:31:40 am »
Thanks Kreso22, this fixed my problem.