Search Unity

Question Dynamically resize quad

Discussion in 'Editor & General Support' started by eco_bach, Feb 25, 2021.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    I have an instantiated quad at default 1x1 or 1 meter by 1 meter dimensions.
    Without being able to set width and length properties directly how does one dynamically change the scale of an instantiated object to predefined measurements?

    ie in my case I need the quad to be 3.7 by 2.5 meters.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    Do you mean just change the
    transform.localScale
    property? That's easy, just assign it.

    If you want to leave identity scaling (1,1,1) then you need to move the verts.

    You're welcome to use my codelet that makes quads of any size. It's part of my MakeGeo package.

    Relevant sources:

    https://github.com/kurtdekker/makegeo/tree/master/makegeo/Assets/makequadplane

    MakeGeo is presently hosted at these locations:

    https://bitbucket.org/kurtdekker/makegeo

    https://github.com/kurtdekker/makegeo

    https://gitlab.com/kurtdekker/makegeo

    https://sourceforge.net/p/makegeo
     
    CrandellWS likes this.