- Home /
 
               Question by 
               IdRatherBeSailing · May 12, 2020 at 11:21 AM · 
                gameobjectpositionscalesizepositioning  
              
 
              Positioning gameobjects by a corner, not by center
I'm trying to display some cube-type gameobjects like in this example: 
The gameobjects are instantiated from a cube prefab object, and using JSON data I need to set the size and the position. The JSON data specifies the x,y,z sizes (which is then applied successfully using transform.localScale), but the JSON position data (x,y,z) only specifies one point, a lower corner:

Given a cubes position is set by its center, how do I position these objects based on the corner instead?
 
                 
                container1a.png 
                (132.7 kB) 
               
 
                
                 
                container2a.png 
                (161.4 kB) 
               
 
              
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                