Search Unity

Anchors on nested UI components not working

Discussion in 'Editor & General Support' started by cgeye, Jun 10, 2021.

  1. cgeye

    cgeye

    Joined:
    Mar 5, 2014
    Posts:
    76
    Hi,

    I have an image component with other images nested inside it. Each nested object has an anchor set to deal with different screen sizes, but for some reason they do not reposition themselves when I go from, say, iPad aspect to iPhone. Is it possible to use anchors on nested objects, or can it be only driven by the parent object.?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Anchors work anywhere in the hierarchy.

    If you change a UI object's scale, you will likely have issues. Maintain unity scaling (1,1,1) always.

    Tinker with anchors in the editor by changing the size / shape of your game window and seeing the effect.

    The effects can sometimes seem counter-intuitive but they do make sense.
     
  3. cgeye

    cgeye

    Joined:
    Mar 5, 2014
    Posts:
    76
     
  4. cgeye

    cgeye

    Joined:
    Mar 5, 2014
    Posts:
    76
    Yeah been trying stuff all day but no joy. Thanks for your help anyway. I'll check scaling etc.