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

Overlapping problem

Discussion in 'UGUI & TextMesh Pro' started by glad, Jan 28, 2015.

  1. glad

    glad

    Joined:
    May 10, 2014
    Posts:
    76
    Hello!

    I have 2 windows(GameObject) and the cards(items) that hold one of the windows. So the problem is shown here:


    when I move the card from one window to another the card is overlapped by another window. When I change the parent it became normal, however, when card is moving(animation) to another window this effect presents. How could I get rid of that thing ?

    Thank you in advance.
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,683
    Can you put a sample project together because I cannot really figure out your setup from the description above. Could be many things, from the Sprite sorting layer of each Window or the Card (windows should be one layer and the card on a higher sprite sorting layer)
    Also how are you transitioning the card from one window to another?
     
    perchik likes this.
  3. glad

    glad

    Joined:
    May 10, 2014
    Posts:
    76
    Hello!
    I created a project without any scripts. Just move the card to another window and you will see that it will be overlapped. It is important for me that parent should be changed after the card is in other window. I first explain my case:
    Card is child of Window1. Moving the card to Window2 cause Window2 to overlap the card while the card is not child of it. And vice versa. I can move card from Window2 to Window1. I am moving the card using Automotion plugin for Unity(basically it is just a coroutine that changes transform.localPosition)
    In Attachment you will find the sample project.
    Thank you!
     

    Attached Files:

  4. Deleted User

    Deleted User

    Guest

    I have the same issue, has there been any resolution ? (attached is my example of the problem)
     

    Attached Files:

  5. Deleted User

    Deleted User

    Guest

    Okay found a solution.

    In the examples above :
    Use the set SetAsLastSibling function on the dragged objects parents transform, I placed the code in IBeginDragHandler.
     
  6. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,683
  7. glad

    glad

    Joined:
    May 10, 2014
    Posts:
    76
    This could be a solution. However I could easily create some example that this solution could not solve. The only solution that I see now is to create by Unity developers the possibility to create some kind of sorting layers.