79611465

Date: 2025-05-07 22:13:14
Score: 1
Natty:
Report link

The area you can scroll within a Scroll View is determined by the size of the Content game object.

When you create an Image as a child of the Content game object, you then have to make sure, that it matches the size of all your images.

If the Images are set up in a horizontal or vertical line, or in a grid, I would advise you to use a Layout Group Component alongside a Content Size Fitter Component set to preferred width and or height.

If the Images are placed more loosely, you probably have to calculate the bounds of all your objects manually. For that, you could iterate over the RectTransforms of your level elements and use RectTransform.GetWorldCorners() to get the bounds and find the bottom left most point and top right most point in your level. With this you can easily calculate the width and height, but you might have to take offsets and scaling into consideration.

More details and maybe an image of your setup could be useful for further help.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Jonas André