John Larrimore

Instantiating scroll rect at a correct position

I'm currently adding a bunch of UI objects to an object set as a Scroll Rect's content. However, I want all of my objects to start in the top left corner of my scroll rect but they are being instantiated in the middle no matter what I do.

I'm not using a grid layout manager because that messes with my ability to sort my objects. Adjusting the location of my content view doesn't seem to help and it seems like there must be a better solution than adjusting the instantiated location of my new objects on the fly just to accommodate my wonky scroll rect.

Do you have any advice?

  • Are you adding the objects by code ?

    if yes, check out this Anchor and Pivot tutorial,  if these are set to "0.5" then the pivot point of your object is in the middle, also it would help better to provide some code snippet and/or a screenshot of your current setup.