Need Help with "Block Breaker" Canvas & Physics Issue

NEED HELP: Having issues with the functionality of the Block Breaker Game within the 2D Unity course.

Problem: my assets stretch as I move the “Game Window” size. Also, the Blue Background Image shows up within the Game Window, but my Ball, Block, and Paddle don’t show up in the Game window during “Play Mode”. Also, my button appears in the Game Window, but not in my edit window. Note: The Button “That’s It”, is within the Canvas window, but my background is not, which is why I don’t understand why it appears. Also, when I hit “Play”, the ball falls straight through the Block, even though both the Block and the Ball have collision boundaries around them.

To the best of my knowledge I have followed the instructions accurately, although I am using Unity 2020 instead of Unity 2018. Can anyone help me out?

I can’t post videos of the problem here, but I have an example over on the Facebook Community Page: https://www.facebook.com/1678004476/videos/10216144464519182/

You’re using a regular box collider, instead of a box collider2d. So unity is checking if they’d be colliding in a 3d space, instead of just checking if they’d collide in 2d.

Problem: my assets stretch as I move the “Game Window” size

Pretty sure that’s because you have set them as children to the Canvas.
So they are treated as UI elements, and scaled with the size of the game window. You want the blocks, paddle and ball to be individual game objects, and definitely not as part of the canvas.

As for why the button isn’t visible I can’t tell from the screenshots. You can double click on it in the hierarchy to have the editor focus on it though.

1 Like

Oh my goodness, thank you! I’d been staring at this for so long; a second pair of eyes certainly helped!

This screenshot shows what’s happening with the button. Again, thanks for your help!

1 Like

Does that mean the problem is solved? :slight_smile:


See also:

Ah, pretty sure you got your Canvas set to Overlay.

So the reason the button wasn’t visible in the editor is, because it was just offscreen basically.
If you set it to screenspace - cameram it should be at the same position in both the editor, as well as the preview window.

And no problem, you’re welcome

Unfortunately, no. Some problems have been, but I still can’t get any of my game objects to appear in the Game Play Preview; yet they move “as if in Play Mode” in the Game Edit Window when I press “Play.”

UPDATE: My game objects had all been on “0” in Pos Z; changing it to “1” made them all appear. My canvas is at Pos Z: “5”, and my camera is at Pos Z: 100. Not entirely sure why this worked, but the problem has been solved. Thank you!

Turns out all my game objects were at Pos Z: “0”; changing this to Pos Z: “1” made them all appear. Thank you.

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

Privacy & Terms