2D Toolkit Forum

2D Toolkit => Support => Topic started by: ThomasH on October 13, 2013, 12:16:24 pm

Title: [Improvement] Extended message when having invalid mesh collider
Post by: ThomasH on October 13, 2013, 12:16:24 pm
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.");
}

Title: Re: [Improvement] Extended message when having invalid mesh collider
Post by: unikronsoftware 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?