Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Expanding size of a primitive in a single direction?

Discussion in 'General Discussion' started by Ed_Boon, Sep 17, 2015.

  1. Ed_Boon

    Ed_Boon

    Joined:
    Oct 19, 2014
    Posts:
    3
    Is there a way to modify the size of a primitive from a single side of that primitive? for example if i have a square sitting on a quad and want to increase its height in the y direction but only in the positive direction, how do you do that instead of it expanding itself in both directions?
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,516
    Generally speaking, you don't. Unity's primitives aren't intended as a modelling solution. If you need more than basic shapes you'll generally want to get some modelling software to make them with.

    There are ways you can get some variation in the shape, though. If you give your shape a parent GameObject and offset the shape within the parent, then you can scale it out from the parent's position instead of from the mesh's pivot. This gets complicated and messy quickly, so I wouldn't recommend doing anything non-trivial with it.
     
    theANMATOR2b likes this.
  3. calmcarrots

    calmcarrots

    Joined:
    Mar 7, 2014
    Posts:
    654
    You can set the pivot to the opposite end of the side you want to scale and then scale the object.
     
    Ed_Boon likes this.
  4. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,353
    Make runtime calculation with scale + position ration.

    So say I scale my object's width by 1 unit from left to right. So move that object by 1 unit to the right to offset it's scale.