Search Unity

Editing Parent/Child Relationships through scripting? Should I be using Editor Scripting?

Discussion in 'Editor & General Support' started by patrickcraig, May 3, 2019.

  1. patrickcraig

    patrickcraig

    Joined:
    Feb 14, 2019
    Posts:
    5
    Hello, I am relatively new to Unity. I have been using GameObject.transform.Setparent() to reorganize the parent/child relationships in the object hierarchy. I tested the script using a UI button in Play Mode, and it works, however all of the parent/child relationships go back to their original state after I exit Play Mode.

    How can I create a script to reorganize the object hierarchy in editor mode?
     
  2. patrickcraig

    patrickcraig

    Joined:
    Feb 14, 2019
    Posts:
    5