BlockBreaker: Screen Resolution difference makes Sprite Offset

I was following along in Block Breaker, and wanted to change my resolution to 1920x1080. When I copied everything (except for the resolution, of course), the paddle was offset to the right. My Screen Size = 6, and my screenWidthInUnits = 16f.

Could someone please explain how I could have fixed it (without going for “Camera.main.screentoworldpoint”)?

Hi Daniel,

What sprite offset do you mean? Could you share a screenshot, please?

Hello, Nina! I can’t seem to figure out how to printscreen with my mouse included. I mean the sprite was off set from the mouse’s position, that it would be quite far to the right of the mouse position, when it should be exactly underneath the mouse.

You could install LightShot. It’s free.

How did you construct the game object that is supposed to be underneath your cursor? Does it have a child with a SpriteRenderer attached? If so, check if that child has got an offset to its parent. If there is no child, there might be an issue in your code.

Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture?

Privacy & Terms