Hello Guest

Author Topic: [Improvement] Extended message when having invalid mesh collider  (Read 3409 times)

ThomasH

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Just as the subject states - we build a lot with 2D Sprites and Mesh Colliders. However, from time to time we get the error "Invalid mesh collider on sprite, please remove and try again." (don't know why, it's quite annoying). However, since we use hundreds of sprites, it's a game of guessing. Therefore, I would suggest to include the sprite name in the error message, to make it easier to find.

The patch would be quite simple:

File: tk2dBaseSprite.cs
Method: CreateCollider()
Replace
Code: [Select]
if (Application.isPlaying)
{
Debug.LogError("Invalid mesh collider on sprite, please remove and try again.");
}
with
Code: [Select]
if (Application.isPlaying)
{
Debug.LogError("Invalid mesh collider on sprite " + sprite.name + ", please remove and try again.");
}


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: [Improvement] Extended message when having invalid mesh collider
« Reply #1 on: October 13, 2013, 02:11:56 pm »
Sure I'll patch this for the next release.  You're not meant to see that error, unless somethings gone wrong. What version are you on, and any idea how you got the error in the first place? Is there a collider attached to a sprite that isn't meant to be there?