{"action":"closed","issue":{"url":"https://api.github.com/repos/Unity-Technologies/ml-agents/issues/642","repository_url":"https://api.github.com/repos/Unity-Technologies/ml-agents","labels_url":"https://api.github.com/repos/Unity-Technologies/ml-agents/issues/642/labels{/name}","comments_url":"https://api.github.com/repos/Unity-Technologies/ml-agents/issues/642/comments","events_url":"https://api.github.com/repos/Unity-Technologies/ml-agents/issues/642/events","html_url":"https://github.com/Unity-Technologies/ml-agents/issues/642","id":315121891,"number":642,"title":"N multiple agents using same brain","user":{"login":"hsaikia","id":5399500,"avatar_url":"https://avatars1.githubusercontent.com/u/5399500?v=4","gravatar_id":"","url":"https://api.github.com/users/hsaikia","html_url":"https://github.com/hsaikia","followers_url":"https://api.github.com/users/hsaikia/followers","following_url":"https://api.github.com/users/hsaikia/following{/other_user}","gists_url":"https://api.github.com/users/hsaikia/gists{/gist_id}","starred_url":"https://api.github.com/users/hsaikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsaikia/subscriptions","organizations_url":"https://api.github.com/users/hsaikia/orgs","repos_url":"https://api.github.com/users/hsaikia/repos","events_url":"https://api.github.com/users/hsaikia/events{/privacy}","received_events_url":"https://api.github.com/users/hsaikia/received_events","type":"User","site_admin":false},"labels":[{"id":687381587,"url":"https://api.github.com/repos/Unity-Technologies/ml-agents/labels/help-wanted","name":"help-wanted","color":"33aa3f","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-17T15:47:26Z","updated_at":"2018-05-17T22:07:46Z","closed_at":"2018-05-17T22:07:46Z","author_association":"NONE","body":"I need to train N multiple agents using the same brain. Since the number of agents is variable, I instantiate them through a script S and an XYZ_Agent prefab. The agent prefab contains the XYZ_Agent script. Now the only thing that remains is to assign the XYZ_Brain GameObject in the scene to the Brain field of the individual XYZ_Agent scripts at runtime. How can I do this? \r\n\r\nRight now, I have a public field for the XYZ_Brain GameObject in script S, where I assign it and while instantiating my agents, I use \r\n\r\n`XYZ_Clone.GetComponent<XYZ_Agent>().brain = XYZ_Brain.GetComponent<Brain>();`\r\n\r\nbut this doesn't work. Do I need to create clones of the Brain as well? \r\n\r\nThank you!"}}
{"actor":{"display_login":"xiaomaogy"}}