1 Hit bricks have strange x co-ordinates compared to Ben's

At the 5:27 mark of Lecture 79, Ben says his 3 “1 Hit” bricks (which he created by dragging out instances of the prefab) have X co-ordinates of 8,9 and 10 respectively. When I try to use those values, the bricks disappear miles off the screen. To get them in the same positions visually that Ben has them, I have to use X values of -1,0 and 1.

Does anyone have any idea what I’ve done wrong? I don’t feel confident to continue and then possibly have it bite me in the backside later on.

1 Like

Hi Mike,

In the Setting Up You Playspace lecture (at 04:30), Ben positions the background at 0,0,0 and then moves the pivot point of the background to the bottom left corner. He then centers the camera over the background, because the background is 16 units wide it is positioned at 8,6,-10 in the center 9and back a bit) because the pivot point of the background was moved -8 units on the X.

It sounds as if you may have missed the pivot point step.

1 Like

Thanks for the really fast reply, Rob. Appreciate it a lot! I’ll go back and check it out :slight_smile:

1 Like

You’re more than welcome Mike.

Also, at the top of Unity, there is a button which alternates between “Center” and “Pivot” which will change where the pivot point is displayed on your GameObjects, obviously if the pivot point is set at the center and you have “Pivot” selected it will still be in the center. :slight_smile:

I went back through the Setting Up Your Playspace video and followed along again. As far as I can tell, I already have things the way Ben tells us. Just in case though, I grabbed some screenshots.


Please tell me if you see anything obvious out of place in these.

I haven’t had any issues with placement values until now (IE Paddle, Ball, Left Wall, Right Wall, Top Wall have all matched Ben’s numbers), so it seems strange to only be seeing them once I choose these bricks.

Thanks in advance for any help you may have. It’s probably something simple and stupid on my part.

Hi Mike,

All of your screenshots look spot on, well done.

This might be a clue though… have a look at your Brick prefabs and see what their individual transforms are set to.

Also, what are the transform positions for your PlaySpace GameObject?, should be 0,0,0, if you double-click it in the Hierarchy the scene view should focus on the corner of the background where you placed the pivot point.

Thanks again for replying so promptly, Rob.

If I double click on Playspace in the Hierarchy, it does indeed focus on the lower left hand corner of the background image(but has the left wall to the left of it still), and the transform positions shown in the inspector are 0,0,0.

As to the “1 Hit” Brick prefabs. In the Project area of Unity, if I go to Assets then Prefabs and then click on the Prefab named “1 Hit”, it has X,Y,Z values of 8,10 and 0 shown in the inspector.

As I indicated in my original question, each of the 3 individual bricks in the play area has an X value of -1,0 or 1 respectively. Which is where my confusion comes from. The example of the first of these (at an X of -1) can be seen in my second screen grab. For what it is worth, each of them has a Y value of 4.

1 Like

For the moment, I have decided to move on with the rest of the videos. Perhaps further on, it’ll pop out to me what is wrong. :slight_smile:

1 Like

Hi Mike,

You’re welcome.

I would be happy to take a look at the project for you if you could zip up the project files. The forum supports files of 10mb or less, so if it is over that you would need to use something like Google Drive or DropBox etc and just pop the link in a reply.

Entirely up to you, but I would be happy to take a look for you. :slight_smile:

Hi, I have a had a similar issue. I found setting the transform of the Bricks game object (the ‘folder’ the 1 hit bricks go in) to 0,0,0 sorted the problem.

1 Like

This solved it for me, too. When putting the 1 Hit blocks into the Bricks gameObject, make sure that Bricks has a transform of 0, 0, 0.

1 Like

Privacy & Terms