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

Question Own OnActionReceived(ActionBuffers actions)

Discussion in 'ML-Agents' started by Azag_Tot, Jul 20, 2021.

  1. Azag_Tot

    Azag_Tot

    Joined:
    Dec 20, 2020
    Posts:
    2
    I make my turn based strategy and I want to call OnActionReceived when it is needed, not every update.
    How I can write my own OnActionReceived(ActionBuffers actions)?
     
  2. andrewcoh_unity

    andrewcoh_unity

    Unity Technologies

    Joined:
    Sep 5, 2019
    Posts:
    162
    Hi @Azag_Tot

    You can do this by disabling the DecisionRequester component on your agent and calling RequestDecision() manually from the game code.
     
    Azag_Tot likes this.
  3. Azag_Tot

    Azag_Tot

    Joined:
    Dec 20, 2020
    Posts:
    2
    Thank you!
    If I use few different GameObjects with few different NN models in my project at the same time and I call RequestDecision() in one Agent script than every GameObjects do actions or just this GameObject does needed action?