Search Issue Tracker

Fixed in 2017.2.X



Found in


Issue ID




Editor crashes when adding text component to game object in play mode via the script



How to reproduce:
1. Open the attached project
2. Open and play ExampleScene
Result: Editor freezes and crashes after some time

Note: crash log is not generated. If one comments this part uiText = uiTextGameObject.AddComponent<Text>(); from DrawableLabel.cs line 96 project doesn't crash. it somehow forces the OnDisabled Unity message fire up for the AFPSCounter.cs MonoBehaviour. It leads to the infinite cycle of the OnDisable \ OnEnable messages

Reproducible: 5.6.0b8, 5.6.0b10
Not reproducible: 5.6.0b7

Comments (6)

  1. jiuer7845

    Mar 27, 2020 13:06 Yeezy Supply Pandora Yeezy Air Force 1 Nike Air Force 1 Nike Air Max 270 Kobe Bryant Jersey Kobe Bryant Jerseys For Sale Kobe Bryant Jersey 24 Kobe Bryant Website Official Pandora Bijoux Yeezy Yeezy Yeezy Shoes Nike Shoes NFL Jerseys Yeezy Boost 350 Yeezy Yeezy Shoes Yeezy Yeezy Yeezy 350 Yeezy Yeezy Shoes Adidas Yeezy Yeezy 700 Yeezy Boost 350 V2 Nike Outlet Yeezy Shoes MLB Shop Adidas Yeezy MLB Jerseys Yeezy 380 Yeezy 380 Nike Outlet Human Races Human Race Shoes Uggs Official Site Pandora Basketball Jerseys Basketball Jerseys Cheap NBA Jerseys Nike Outlet Pandora Canada Pandora Charms Pandora Jewelry Pandora Outlet Pandora Jewelry Official Site MLB Jerseys Pandora Pandora Bijoux Adidas Yeezy Pandora Soldes 2020 Yeezy Shoes Yeezy Mafia

  2. Krstn

    Jun 08, 2017 07:41

    When can we expect this to be released?
    5.6.1f1 still has this bug.

  3. HarryCodder

    Apr 10, 2017 07:24

    Yeah but this workaround will not work in an Awake call because of this bug :
    The change you mentioned seems to cause a lot of UI related problems, how did it make it to so many branches ?

  4. karl_jones

    Mar 01, 2017 16:48

    We have made some changes that require us to disable and then reenable the entire transform hierarchy whenever we replace a Transform with a RectTransform. This has created the undesirable side effect of calling OnDisable/OnEnable on all scripts attached to the hierarchy. This is a behaviour that we intend to address in the future.

    There is a simple workaround for this though. The problem is caused by when we swap the transform, so a simple solution is to add a RectTransform or UI element to the GameObject on creation so that the swap does not need to be performed.

    For example
    var go = new GameObject("Canvas", typeof(RectTransform));

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.