Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How to call OnEnvironmentReset when MaxStep is reached

Discussion in 'ML-Agents' started by SaroVati, May 31, 2020.

  1. SaroVati


    Jun 7, 2015

    Haven't found an answer to this, but I have a few functions that subscribe to the OnEnvironmentReset, but OnEnvironmentReset is only called at the start of my training, and never when MaxStep is reached. It feels like I'm missing something extremely simple, but I can't find the issue.

    On further research, I understand the use case of OnEnvironmentReset. My question now is: Is there a built in event for when MaxSteps is reached, or should I design that myself? All of my agents currently would be acting with a MaxStep of 5000, and I'd like an "OnEpisodeEnd" event to subscribe and reset my environment with.

    Any help would be great!
    timediv likes this.