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

OnTransformChildrenChanged problems

Discussion in 'Scripting' started by Chris-Trueman, Jul 20, 2015.

  1. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    1,256
    When I try to use this event I get some problematic behavior.

    It triggers twice when I add a child to the transform, but it will only trigger when I remove a child if that child gets destroyed. If I change the child's parent to something else the event does not trigger. Does anyone know why this would be happening?
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    1,256
  4. dheron

    dheron

    Joined:
    Jun 24, 2013
    Posts:
    2
    Just ran into this using 5.3.0f4 Personal. Looks like it has been six months since the bug was logged. Is there going to be any movement on this? Or should I just design around this bug?
     
  5. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,076
    I just ran into this bug with unity 2017.1.1f1... How can such a bug not be fixed for so long?
    Instead of making unity stable and reliable they always add new features with new bugs to the new versions :(
     
  6. _watcher_

    _watcher_

    Joined:
    Nov 7, 2014
    Posts:
    259
    The sad news is, that this basic feature is still not fixed after 8 years.
    The good news is, that you can read on how to buy halloween and wedding dresses on the same tracker link.

    The reason why the ADD event triggers twice seems to be:
    1) first trigger for adding item
    2) second trigger for other items having to update their displayList indexes.

    Anyone got an idea how otherwise to check for this efficiently? The bad old 'check child count on update and emit, if count changes' comes to mind, but i'd rather skip on that one.