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 Way to change ISystem OnUpdate to OnFixedUpdate?

Discussion in 'Entity Component System' started by MatanYamin, May 15, 2023.

  1. MatanYamin

    MatanYamin

    Joined:
    Feb 2, 2022
    Posts:
    109
    Hi, this might be a weird question but is there a way to make the ISystem OnUpdate actually runs in a FixedTime update, or in other words, in an "OnFixedUpdate" or something like that instead of the regular OnUpdate?

    Thanks!
     
  2. SillyConesValley

    SillyConesValley

    Joined:
    May 13, 2023
    Posts:
    6
    by default, systems update in "SimulationSystemGroup" (runs every frame). For fixed update, add a [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))] to your system. This makes the system's "OnUpdate" get called on fixed updates only
     
    MatanYamin and xVergilx like this.
  3. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,292
    MatanYamin likes this.
  4. MatanYamin

    MatanYamin

    Joined:
    Feb 2, 2022
    Posts:
    109
    xVergilx likes this.