Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved How to order system groups?

Discussion in 'Entity Component System' started by iSinner, Sep 15, 2023.

  1. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    I didn't find any way to sort system groups. For example i can't put my own system group to be running before FixedStepSimulationSystemGroup.

    OrderBefore and OrderAfter attributes don't work for system groups.

    Is this just not possible atm?
     
  2. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    282
    Not sure what you mean by OrderBefore or OrderAfter. System order is changed via UpdateBeforeAttribute and UpdateAfterAttribute. These attributes work for system groups, as these are merely managed systems (derived from ComponentSystemGroup, which is derived from SystemBase), and the main meat of groups is merely updating other systems from the group’s OnUpdate implementation.

    Failure to change the ordering is likely a bug. In this case, it would be best to show the code you tried to set things up and the evidence that things are not working.
     
  3. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    You're right, i messed up the names of the attributes when i wrote the post.

    While i was preparing the screenshots and all that, i discovered that unity logs a warning and tells why it didn't want to order my system group before the FixedStepSimulationSystemGroup, it is because the FixedStepSimulationSystemGroup is marked as OrderFirst, which takes precedence over UpdateBefore/After attributes.

    Thanks for the help.