Closed
Description
Multiple places in the ML-agents code use FindObjectOfType for getting the Academy.
This gives lag spikes for every time an agent is enabled or given a new behaviour.
In large scenes this lag spike can be rather noticable. It can also cause increased scene load times if there are many agents.
In my current project we have made Academy into a singleton, but there are other ways too. Just avoid searching the entire scene would be good :)
Cheers!