Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

What is ScheduleUpdate().Complete() doing for me here?

Discussion in 'Multiplayer' started by bibbis, Mar 16, 2020.

  1. bibbis


    Dec 5, 2016
    I'm digging into the Unity Transport preview package and following the example in the manual here:

    I'm confused about the usage of: m_Driver.ScheduleUpdate().Complete();
    It says that we have to "make sure to call the Complete method on the JobHandle that is returned, in order to know when you are ready to process any updates."
    How does calling this function allow me to know if the job is complete?

    If I was instead doing this:
    if (m_Driver.ScheduleUpdate().IsCompleted)
    Then yeah, it would make perfect sense, but as it stands right now it just doesn't make any sense to me.
  2. Neto_Kokku


    Feb 15, 2018
    Calling Complete() on the JobHandle will block the main thread until the job completes.
    bibbis likes this.
  3. bibbis


    Dec 5, 2016
    Ah I see.
    Thank you