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. Dismiss Notice

Move a whole Vector3 list of lists to another world position

Discussion in 'Editor & General Support' started by valter-home, May 1, 2020.

  1. valter-home

    valter-home

    Joined:
    Sep 22, 2015
    Posts:
    73
    Hi everyone, with my editor I build an environment with a background image and related sprites (I work in 2.5D). I also draw on a Plane some shapes with Gizmos and I save vertices in a list of Vector3.
    For somewhat lengthy reasons to explain I work with the background image placed at 0, 0, 0.
    Once the work is complete I need to move the whole environment to another world position and I get it by making all the gameobject children of the background image.
    Now I'm wondering if there is a function in C # that allows to update each Vector3 contained in the list with respect to the new position taken by the background image or if I have to modify them one by one iterating over the list.
    Any suggestions would be welcome.
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    valter-home likes this.
  3. valter-home

    valter-home

    Joined:
    Sep 22, 2015
    Posts:
    73
    Not only does it help but it solves perfectly. Thanks.
     
    DiegoDePalacio likes this.