Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Instantiate prefab Slots and Aligning it with Grid Layout

Discussion in 'UGUI & TextMesh Pro' started by meapps, Oct 11, 2014.

  1. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    4.6b20

    Instantiate prefabs from my inventory and aligned it with Grid Layout and use on the Canvas Reference Res.

    Looks and works perfect in the Game View, but Instantiate Prefab are smaller on my Testing Device Nexus 7.

    GameView


    2014-10-11 23_35_39-Unity - Main.unity - master-of-potion-new-gui - Android_ _DX11 Gameview_.png

    Nexus 7

    Screenshot_2014-10-11-23-37-36.png

    Game view Prefab Scaling increase 3x
    2014-10-11 23_38_27-Unity - Main.unity - master-of-potion-new-gui - Prefab scale 3times_.png

    Nexus 7

    Screenshot_2014-10-11-23-39-41.png


    It looks like the Grid Layout scaling and Spacing is not working on mobile.

    Anyone similar issues?
     
    Last edited: Oct 12, 2014
  2. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    slot.transform.SetParent(this.transform, false); seems to fix it
    then it works better and can be adjust under prefab scaling too.

    before i had used slot.transform.parent=transform;
     
    domkia and runevision like this.
  3. celaeno

    celaeno

    Joined:
    Jan 31, 2013
    Posts:
    54
    Thanks! I walked upon this problem and saw your post, otherwise it would've given me a headache.
     
  4. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    i am glad it helped you it gave me an headache in the past.
     
unityunity