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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to get a stable timer ?

Discussion in 'ML-Agents' started by Delt4a, Jan 12, 2023.

  1. Delt4a


    Jan 23, 2020
    Hey, I am beginning to experience with MLAgents, and I am trying to do something where if the Agent don't reach a target in an amount of time (countdown timer), I call EndEpisode() and give a negative reward.

    I saw this

    But even while doing it in FixedUpdate and with a --time-scale=1 I can see that my timer isn't stable, and even the whole game is going faster than at the same scale without MLAgents?
  2. smallg2023


    Sep 2, 2018
    Time.fixedDeltaTime for FixedUpdate, it records how long since the last FixedUpdate was called and should return the same time if the game loop is able to run optimally, I can't see why you would have any issues adding a timer with it - how are you coding your timer?