- Home /
GridLayout dynamic cell size based on object count
I am trying to figure out a code to dynamically calculate gridlayout cell size based on how many objects I wish to fit in it. Say I have a grid of 1000x600 and wish to fit 60 objects in it, to achieve that I can use size of 100x100. What is the formula used to calculate 100x100?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612124238im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Height Value of Rect Transform cannot be changed via script 1 Answer
Change each cell size based on amount of text in grid layout group 1 Answer
Increase height of panel w/ gridlayout when new objects added 1 Answer
Creating a grid for word-puzzle game? 1 Answer
Decrease size of grid with prefabs? 0 Answers