- Home /
Bounds larger than expected
I'm not quite sure I understand how collider.bounds and renderer.bounds actually work. When I import a model from Blender (or create a standard one in Unity), the bounds look this way (just as I expect):
But when I rotate the model around global Y axis, the bounds transform and become significantly larger than the collider:
Why does this happen? As far as I know, the bounding box must always stay as small as possible, yet able to encompass the whole collider.
I'm using a very simple script to draw the box:
private void OnDrawGizmos()
{
var bounds = collider.bounds;
Gizmos.DrawWireCube(bounds.center, bounds.size);
}
What confuses me even more is that renderer.bounds produce the same effect.
Answer by 0xc0dec · Feb 20, 2013 at 06:39 PM
Well, seems like collider.bounds and renderer.bounds actually enclose the object with its mesh bounding box. One of this question's comments has the following picture which gave me the clue:
I'm not sure if it is right, but it exactly matches the results that I observed during my experiments.
Your answer
Follow this Question
Related Questions
Can't convert Bounds from world coordinates to local coordinates 6 Answers
Having Converision error with foreach loops 3 Answers
How to adjust two colliders really close to each other w/o them colliding? 1 Answer
Changing two different objects renderer colour 1 Answer
[CLOSED] renderer.enabled is set to true but does not show 0 Answers