Skip to content

Instantly share code, notes, and snippets.

@wiverson
Created May 15, 2023 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wiverson/2b4cdd2fe3d5a117579320cbce6ae737 to your computer and use it in GitHub Desktop.
Save wiverson/2b4cdd2fe3d5a117579320cbce6ae737 to your computer and use it in GitHub Desktop.

To center something with a maximum width:

  1. Parent GameObject
    1. Add Horizontal or Vertical Layout Group
    2. Enable 'Control Child Size' and Disable 'Child Force Expand'
  2. Child GameObject
    1. Add 'Layout Element'
    2. Set Preferred Height and/or Width
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment