Technical question about Block Breaker

Hi,

Quick question about the blockbreaker Udemy tutorial. I’m at section 5, episode 74 (The Complete Unity Developer), where you have to create a C♯ Script for the Paddle.

I just entered the code to make the paddle move with the mouse. It works, it does move with my mouse, but the paddle is way more to the right than my mouse.

I tried to enter position X 8.0110, Y 0.5 for the paddle object (like shown in the tutorial), but it makes the paddle appear outside my game screen (although in the tutorial it gets positioned at the center). My guess is I messed up the coordinates of the background maybe ? The C♯ Code I entered is correct, so it must be something in the Unity settings.

If somebody knows why my paddle is off, please share :slight_smile: Otherwise I’m afraid I have to begin the tutorial from the beginning to make sure I didn’t miss a step somewhere.

Many thanks :slight_smile:

Hey @DudetteAlex,

Could you stop the game running, click on the Background GameObject in the Hierarchy and with the Inspector visible, post up another screenshot please.

Let’s see what we can find :slight_smile:

Thanks for your quick reply! You guys rock on this forum :))

The screenshot is attached.

1 Like

You’re more than welcome - I should have added, please make sure you have the move button pressed! (my bad)…

It’s the second one in from the left on the bar at the top next to the hand icon. :slight_smile:

1 Like

Thanks @DudetteAlex, so, some things to check;

Did you move the pivot point to the bottom left hand corner of the background? I notice that you have Center selected at the top. Based roughly on your first screenshot I would suggest you are approximately 8 world units out, which would be half of the playspace.

The left hand side of the playspace should be -8 on X and the right hand side should be 8 on X. (Lecture 68 @ 03:37)

Can you confirm this is the case.

Hi,

Thx for your help.

So I checked, playspace is in fact at -8 X on the left and 8 X for the right side. So that is correct.

I changed ‘Center’ to ‘Pivot’ at the top.

Having the background object selected, it shows me the pivot being in the center of the image. (image attached) However, if I try to click and drag it to the bottom left corner, it drags the whole background image with it. I see in the tutorial that it’s possible to drag the pivot independently to the bottom left corner. Any idea what I’m doing wrong ?

Thanks again
(and if we don’t find the solution I’ll restart the tutorial from beginning, no biggie) :slight_smile:

1 Like

Hi,

  • Expand your Assets folder, then expand the Sprites folder.
  • Click on the background image.
  • In the Inspector you should have the following

    Lecture 68 from 01:18, specifically 04:27 - Sprite Editor / Pivot Point

Please check / correct and then let me know if you are still having problems, if so, please paste up the code from the script file also.

Niiice, that fixed it. Now it works. It said ‘Center’ instead of ‘bottom left’ for pivot in the inspector.
Awesome. thank you so much :smiley:

I can continue the tutorial now :))

1 Like

Great stuff, glad you have it working as it should - enjoy the rest of the course :slight_smile:

Privacy & Terms