Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How destroy a agent? and Best way to do[ML-Agents 0.13.1]

Discussion in 'ML-Agents' started by arklink, Feb 19, 2020.

  1. arklink

    arklink

    Joined:
    Nov 25, 2019
    Posts:
    1
    Hello guys, i want to know the best way to destroy a agent, I had a Agent eating a target, in case the agent can´t eat, the agent died, i use 3 methods to try to destroy the agent but anyone works
    Destroy(this.gameObject);
    Destroy(gameObject);
    Agent.Destroy(this);

    the agent was trained, i want to destroy it in the scene
     
  2. jeffrey_unity538

    jeffrey_unity538

    Unity Technologies

    Joined:
    Feb 15, 2018
    Posts:
    59
    hi arklink - to clarify, you are trying to destroy the agent in inference mode (i.e. not training?)
     
  3. unity_Z5c3tcfoTCizWA

    unity_Z5c3tcfoTCizWA

    Joined:
    Nov 10, 2017
    Posts:
    4
    I'm also looking for best practice for dynamically instantiating and destroying agents in inference mode. Any suggestion? Destroy() seems to be fine, SetActive(false) is also working somehow, but Instantiate(agent) crashes my unity without warnings. Any idea? Thanks! :)
     
    OrSimhon likes this.