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 CollectDiscreteActionMasks Problem

Discussion in 'ML-Agents' started by ilaydanil, Jun 3, 2020.

  1. ilaydanil

    ilaydanil

    Joined:
    May 17, 2020
    Posts:
    20
    In my game, I have implemented CollectDiscreteActionMasks function, but I don't think it is being called. For testing purposes, I have put Debug.Log() at the beginning of the function but there is no output. How does it work? Does adding the CollectDiscreteActionMasks to an agent's code make it called automatically?
     
  2. MrWetsnow

    MrWetsnow

    Joined:
    Jan 5, 2020
    Posts:
    60
    In general, yes. Can you please post your code? Did you set `Academy.Instance.AutomaticSteppingEnabled = false;` by chance?
     
  3. celion_unity

    celion_unity

    Joined:
    Jun 12, 2019
    Posts:
    289
    Also, make sure that you Agent's action space is set to Discrete. Masking has no effect for continuous actions, so CollectDiscreteActionMasks isn't called then.