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

Question How do I rescale every copy of an object without them moving?

Discussion in 'Editor & General Support' started by Altsor, Feb 18, 2023.

  1. Altsor

    Altsor

    Joined:
    Apr 7, 2022
    Posts:
    2
    This is a noob question. I have been trying to search for answers but I might be formulating the question wrong.

    Say I make a game object that is a tree, and I then place hundreds of copies of them everywhere.

    Now I decided my trees should all be slightly larger. How do I do this without having to change the scale of each tree separately?

    If I put all the trees as children of one tree and try changing that I am scaling the whole set of trees and they all move around. That's not want. Thankful for help.
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,903
    There's no built-in way to do it.

    If the trees you placed were prefabs, and the prefabs had been constructed with an Empty parent and a child for the graphics (a common but optional approach), then you could adjust the child in your prefab and that change would propagate to all placed objects.

    Jason Weimann offers this extension class that would allow you to do a sort of "search and replace," replacing the selected objects with a prefab of your choice.

     
    Altsor likes this.
  3. Altsor

    Altsor

    Joined:
    Apr 7, 2022
    Posts:
    2
    Prefab is the word I'm looking for then! Thanks. I knew the function you describe must exist but didn't know the word for it. I'll look into how prefabs work.

    Luckily my example was purely hypothetical so I hopefully don't need the guide you linked. If I do make hundreds of trees ill make sure they are prefabs.
     
    halley likes this.