- Home /
How to suppress BoxCollider warning
Hi, I'm getting the warning we've seen reported in other threads:
BoxColliders does not support negative scale or size. The effective box size has been forced positive and is likely to give unexpected collision geometry. If you absolutely need to use negative scaling you can use the convex MeshCollider. Scene hierarchy path "TileMap Render Data/Main/Chunk 2 11/MyPrefab 1"
I've researched this and understand why this happens. However, we are using a 3rd party tool which negates the scale of the parent object (BoxCollider is child), and we have no control over this from our side. We are completely comfortable and know the risks, and simply want to suppress the above warning, as it spams our logs even though everything is working fine. Is there any way to suppress this warning? Thanks!
Answer by omarmoh-om · Aug 15, 2017 at 09:13 PM
Check my answer on the same subject of matter on
Best of luck
Answer by andzq · Oct 14, 2016 at 10:57 PM
Warnings in Unity usually come with an ID.
For example:
Declaring the variable - float foo - but never using it results in the following warning:
Assets/myScript.cs(8,16): warning CS0168: The variable 'foo' is declared but never used
You can suppress this warning by adding this line of code at the top of your script:
using UnityEngine;
using System.Collections;
#pragma warning disable 0168 // <<<< that one
public class MyScript : MonoBehaviour {
void Start()
{
float foo;
}
}
Maybe this helps. Good luck (:
thought it should be obvious, I got to mention that you need to change the number after disable to the number of your warning
Thanks! I actually went down this path, but couldn't find a warning ID for this one :-/ The entire message is pasted above and I don't see any associated ID. $$anonymous$$aybe at least an ID can be added to this in a future version?
That´s unfortunate. Having your console flooded with warnings that you can´t disable is really annoying. $$anonymous$$now that feel :/
Yes, but I'm more concerned about the output log generated from the built game
It's actually the C# compiler that has IDs with warnings. All Unity warnings don't have IDs and can't be disabled this way.