1
Support / Re: Collider Issue in 4.3
« 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
}
}
}
}
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
}
}
}
}
