Box collider bigger than it should?

Im using unity 2017 and heres my issue with Box Collider 2D: excluir14
This is how the paddle stops the ball, this massive gap is kept like if the collider extended all the way up.
Even though it doesnt:


I tested if the collider acts weird in horizontally too, but it doesnt, only vertically and I have no idea why.

Hi Mauricio,

Looking at your screenshot, if I stood one of your blocks on its end, so it was vertical, it looks like it would fit from the bottom of the paddle to the ball.

image

This leads me to suspect that the sizes you have for the BoxCollider2D are incorrect and that the X component value has been also used for the Y component.

Select the brick in the scene, then look at the BoxCollider2D component within the Inspector, what value do you have for Y?

image

Remember, if the brick has been prefab’d then you’ll want to update the values on the prefab.

From memory, I believe this was covered near the beginning of the section where there is a talk about pixels per unit for the sprite and the ratios. Typically, Unity will automatically size the BoxCollider2D correctly around the sprite, but depending on your workflow this may not have happened.

1 Like

Hello Rob, thank you for the help!
Your theory makes sense, but the values for my collider looks fine:
excluir17

Hi,

So, if we assume for now the paddle is ok, that would leave the ball. What does the CircleCollider2D properties look like?

Like this:

Can the ball still fall down out of the screen if the paddle is nowhere near it?

Yes it can

Hello Mauricio,

Can you pop up a screenshot of the Lose Collider selected in the Hierarchy with its details visible in the Inspector please.

Hi Rob, sure

1 Like

Well, I did not change a single thing in my project, now the collision box is working perfectly, I have no idea why but problem solved I guess…excluir2

2 Likes

hehe, it’s really annoying when that happens as you can’t trace what the step was that actually resolved the issue for you.

Oh, well, at least you are able to move forward. :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.