new to unity and very exitet! my first question: i want to instatiate objects besides each other and need to know their individual width in the direction they could possible overlap. actually i want to add a variable called "space" for the gap inbetween the positioned objects.
f.e. if i want to position the objects in a row like
so how do i get the specific width of an gameobject in one direction?
edited: if the prefabs are Empty's with children of many objects, is there a way to detect the cild with the biggest Renderer-Bound?
Note, however, that these sizes will be for the Un-Scaled size of the object (as if its scale was 1,1,1), and the directions (eg, in the size x,y,z values) will be relative to the objects local coordinates.
To position your objects next to each other with a specified gap between, you might modify your code to look something like this:
answered Apr 22 '10 at 10:11 AM