Search Unity

Hierarchy Doesn't Update During OnDrag?

Discussion in 'UI Toolkit' started by JamieRoss95, May 16, 2019.

  1. JamieRoss95

    JamieRoss95

    Joined:
    Apr 5, 2016
    Posts:
    28
    I am in the process of rebuilding some of my UI systems for my game and I came across an odd bug. It seems that the hierarchy information doesn't seem to update for items that are currently being used by OnDrag(IDragHandler).

    I have a system set up where when an item is being dragged its parent is changed to another canvas so that it is always on top of the other UI elements and other items that are not being dragged. However, I have noticed that during playtime while dragging an item it doesn't show up as a child of the "UsingScreenUI" canvas even though it acts as it is.

    Just wondering if anyone else has had this issue or if there is a way to "fix it". It is not a big deal as it works correctly, but this caused me a HUGE headache for the last 3 hours because I thought that the system wasn't working because there was no visual feedback in the hierarchy that it was working.



    The "Pickup_CoinUI" should be a child of "UsingScreenUI" in this screenshot as I was dragging it, but it is not. Even though the Pickup_CoinUI is behaving as it should (remaining in-front of all other UI elements).

    [EDIT] I just confirmed this again using print command in the Update() that showed item's current parent (in truth I should've confirmed using this method way earlier but it has been a long morning lol). As suspected the parent is changing correctly but this information is not being presented in the hierarchy. Does anyone have an idea of how to report this to Unity?
     
    Last edited: May 16, 2019
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    JamieRoss95 likes this.