Search Unity

Deactivating a GameObject kills all Coroutines running on its scripts

Discussion in 'Documentation' started by Chris_Entropy, Sep 14, 2016.

  1. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    I just found out, that all Coroutines are ended without a warning, not paused, but completely stopped, as soon as a GameObject gets deactivated.
    Could there be an addition in the Manual and API documentation of Coroutines and maybe GameObjects, that make this clear?
     
    Last edited: Sep 14, 2016
    SarfaraazAlladin likes this.
  2. SarfaraazAlladin

    SarfaraazAlladin

    Joined:
    Dec 20, 2013
    Posts:
    280
    Really good to know!
     
  3. FreeFly90

    FreeFly90

    Joined:
    May 28, 2016
    Posts:
    177
    Curious. Really nice catch, I definitely agree it should go on the official Coroutine documentation!