Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Inside the AddComponet function, GameoObject temporarily becomes Disable.

Discussion in '5.6 Beta' started by madnesslabo, Mar 18, 2017.

  1. madnesslabo

    madnesslabo

    Joined:
    Nov 8, 2012
    Posts:
    60
    Hey there,

    I tried opening my project with Unity 5.6.0 f1.
    However, it did not work properly.
    The cause was that the coroutines had stopped.
    I looked for the cause of coroutines stopping.
    StopCotouine etc are not called.
    The cause was to make the object Disable at unintended timing.
    It is called at the time of AddComponet.
    Strangely enough, that AddComponet is calling for another object.

    This is the stack Torres of Debug.log.


    Immediately inside Disable, it is set to Enable inside AddComponent.
    As a result, the active state returns to its original state, but in this way the coroutine stops. It is not good to be called at an unintended timing.

    I tried to reproduce it by making a simple project, but it does not reproduce.
    There seems to be some condition.
    It did not happen until Unity 5.5.2.
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Hi goodtime,
    Could you please submit a bug report with the project attached and reply in here with the case #?
     
  3. madnesslabo

    madnesslabo

    Joined:
    Nov 8, 2012
    Posts:
    60
    Hello. Thank you for your reply.
    My bug reports are (Case 892530) and (Case 892500).
    The coroutines are stopped by calling OnDisable.

    I was replied as a known problem.
    Https://issuetracker.unity3d.com/is...nt-to-game-object-in-play-mode-via-the-script

    I hope that the problem will be resolved by the official release of Unity 5.6.
    Since it affects all the components of the hierarchy, I think that the problem will frequently occur.
    If such a change can not be avoided, please let me know by Warning or Error.
    Now I have a hard time finding out when the coroutines have stopped.
     
    LeonhardP likes this.