Search Issue Tracker

By Design

Votes

1

Found in

4.6.0b17

Issue ID

655978

Regression

No

Instantiating UI prefab as a child of UI element which has disabled Canvas/does not have Canvas sets Scale to 0

UI

-

To reproduce this issue:

1. Open 'TestScale' project
2. Open 'scene'
3. Play the scene
4. Press Button 'New Game' which instantiates UI prefab 'Image' on disabled Canvas('Canvas2') and then enables it
5. Notice 'Image(Clone)' ( Canvas2->Add Player) has Scale(x,y,z)=0
6. Now Click New Game again
7. Now it instantiates correctly as Canvas is already enabled

Comments (3)

  1. bjlay2000

    Nov 07, 2019 14:18

    This is still an issue in 2019.2.6f1

  2. deanG

    May 18, 2015 18:05

    Can confirm this is still present in 4.6.2f1.

    We are creating instantiated cards in a scrolling list where the card prefab scale is currently being set to 0 on instantiation. Our workaround is the line after instantiating the prefab we forcibly set its RectTransform scale to 1. This works well but it would be great to have the bug fixed!

  3. johne5

    Feb 09, 2015 16:03

    The current work around that I use for this is to add a Canvas Group component to the second canvas and in my script I change the alpha from 0 to 1 to enable and disable the second canvas. I hope that is a good work around for you.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.