Search Unity

Resolved What is the order of execution of consecutive custom events?

Discussion in 'Visual Scripting' started by Marou1, Jun 11, 2022.

  1. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    Hi,

    When a custom event is triggered, does is it run in parallel or are all its instructions executed before resuming the flow? Case2.png case1.png

    In the first case, instruction C could be executed after event2 is trigger which would cause a bug.

    Thanks
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,077
    It does not wait for anything. If you need for something to happen before continuing the rest of the flow, add time related nodes such as Wait Until or Wait for Next Frame.
     
    Marou1 likes this.
  3. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    Ok thanks! I thought Unity was not multithread and instructions were executed in a sequential order, not in parallel.
     
  4. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,077
    Disregard my previous comment, I was misunderstanding how UVS reflection runtime hands out instructions to the thread in a custom event scenario.

    The second image is correct, and Unity and UVS are not multithreaded by default.
     
  5. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    Ok thanks for the information!