Search Unity

Weird behaviour when re-parenting after SetParent to null.

Discussion in 'General Discussion' started by eterlan, Feb 13, 2020.

  1. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    119
    Unity 2019.3.0.f3
    How to reproduce:
    1. Create a new 2D project.
    2. Create a square sprite and drag it to the scene 3 times, with different positions.
    3. Make one square parent of the other two squares.
    4. Write a script for one of the children, and set its parent as null on Start();
    5. Enter play mode, drag both children in & out, the one which set its parent as null would rotate weirdly.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,680
  3. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    119
    karl_jones likes this.
unityunity