Linear or random distribution of GameObjects in the Inspector
Unity's Inspector has some hidden gems! One of them is a linear or random distribution of items via L(min,max) or R(min,max).
You may know that you can calculate some values within the transform component in the inspector:
But did you know that the inspector also can do a linear or random distribution of your selected items?
Select a bunch of objects and then type in: L(0, 100)
. It will now distribute all selected items evenly between 0 and 100. If you use R(0, 100)
it instead, it will randomly distribute all selected items between 0 and 100.
Also works with rotation and scale.
Have not found anything about this yet in the docs, if you do, ping me on Twitter! Would be nice to know which other hidden gems the inspector is able to do.
Thanks to Ciro Continisio who pinged Aras Pranckevičius on Twitter, he pointed us to the Unity documentation having the information!
Cheers!