After upgrading to 5.3.4f1, ball tends to break through blocks

Problem
After upgrading to Unity 5.3.4f1, I noticed an odd behavior in my Block Breaker. Ball tends to smash and go through blocks hitting block behind it, or crashing through it.

Expected behavior
Ball should bounce after each hit

Anybody has some idea?

1 Like

Hi @Bashar, when you say it goes through a block and hits the block behind it, does it also pass through this block, or does it bounce off?

is it only going through certain block types?
Any errors / warnings showing in console.

Walk through the mechanics of what should be happening, and check each step against what is within the vid), going to be a process of logical steps to what should happen against what is happening, like…

Is the collision being registered with the brick and ball. if not break that part down first.
does the brick take damage. if not why
etc

or have a run through collision detection with the bricks section again. follow it through and see if anything has changed, I know that sometimes when you upgrade mid project it messes up the tag assignments sometimes.

Just as a bit of advice for future, I would say its best to complete a project first before upgrading the editor.
That way it will be consistent throughout that projects lifetime, and once you upgrade the version you have a clean slate for starting the next project.

(done it myself, once and once only, as it caused numerous head scratching hours to go back and resolve)

2 Likes

It does register the hit, so block eather cracks or gets destroyed, but it’s like the ball has strong force and doesn’t get deflected sometimes. It continues up.

Thanks. I’ll do more debugging. I had the full project running, and only upgraded towards the end. The collision is definitely registering as the block cracks or gets destroyed. The ball trajectory doesn’t always change however. Sometimes it keeps moving in same direction.

I will give it more look. I just thought it may not be only. Apparently it is somehow.

i did have this issue @Bashar use OnTriggerExit2D(Collider2D col) instade , solves it

Thanks. Didn’t work for me.

Will look more into it later when I have the time

hmmm , it should work , you do this change on the brick Script only , if it remains the same , then remove the “Destroy(gameObject);” line , and check if the ball goes through the brick , if it does then check your colliders weather if they are set as isTrigger or not , if its not set as isTrigger then use the “OnCollisionExit2D(Collision2D collosion)” good luck :wink: @Bashar

1 Like

Sorry, might have not explained clearly. The block is getting cracked and damaged. Problem is with the ball not stopping after collision. So change should be at ball script.

see video https://youtu.be/VTHgYOlYDZQ

1 Like

can i see both the ball and the brick code? , and if u can upload a screen shot to collider settings for both of them , i might be able to help more @Bashar

Never mind. Got it. Collision Detection on Ball’s Rigidbody 2D had to be set to Continuous not Discrete

2 Likes

Nice spot @Bashar, well done, please mark your post solved as this may well help other people in the community too :slight_smile:

1 Like

thanks. done

1 Like

Awesome :slight_smile:

Thanks for posting this question and solution (changing collision detection from discrete to continuous) - I was having the same issue with the ball falling through the paddle!

2 Likes

Glad it helped :slight_smile:

1 Like

Privacy & Terms