Search Unity

Scaling Objects?

Discussion in 'Scripting' started by Kripto, Mar 5, 2008.

  1. Kripto

    Kripto

    Joined:
    Feb 12, 2007
    Posts:
    119
    Any body out there have a streamlined way to scale objects in realtime using a script? I've tried a few approaches but no luck so far...

    I've also searched the forum to no avail. Any help would be greatly appreciated!

    Thanks! :D
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Try this:

    Code (csharp):
    1. transform.localScale = new Vector3 (1, 0.5, 0.5);
     
  3. Kripto

    Kripto

    Joined:
    Feb 12, 2007
    Posts:
    119
    Thanks! I found similar code in my notes but had issues. They ended up being tracked down to one object's scale being offset during import for some reason...

    Thanks again!