Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

FixedUpdate() equivalent in Unity Tiny

Discussion in 'Project Tiny' started by trumptech-trevor, Sep 8, 2020.

  1. trumptech-trevor

    trumptech-trevor

    Joined:
    Sep 8, 2020
    Posts:
    1
    Is there any FixedUpdate() equivalent function in Unity Tiny? I have searched for a while and I know some people asked the same but couldn't get a working solution.

    Thanks
     
    NotaNaN and tonialatalo like this.
  2. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    Hey
    Yes, we do but its a little bit different than classic Unity.

    First of all, make sure to have UNITY_DOTSRUNTIME_EXPERIMENTAL_FIXED_SIM defined in the build settings
    upload_2020-9-9_13-13-16.png

    Then in your system add [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))]
    Then the system OnUpdate() will be triggered with a fixed time step

    Code (CSharp):
    1.    
    2.     [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))]
    3.     public class MySystem : SystemBase
    4.     {
    5.         protected override void OnUpdate()
    6.         {
    7.            // Fixed time step updates
    8.         }
    9.     }