Closed scscgit closed 4 years ago
HI @scscgit, This is great feedback. We have discussed this internally and will address the issue ASAP. We have logged the issue internally as MLA-739, and will update this thread when a fix is merged into master.
Hi, The fix for this was merged into master from #3590. Please open this issue again if a problem persists.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
The
MLAgents.Agent
is a MonoBehaviour, which includes private functions likeOnEnable
andOnDisable
that always have be called, yet it's possible for the user to implement their own new private methods, which Unity calls using reflection instead. When the user does so, there's no visible error, yet the framework silently fails to initialize, and the Agents don't call any actions. My suggestions are as follows:This is especially important when the user uses APIs like NavMeshQuery that use an Allocator, which strictly require to be disposed and re-allocated when using Play Mode Options. An example use-case is adding a simple observation vector of a NavMesh Raycast.
There is currently a possible workaround to invoke those private functions using a reflection. Here is an example if anyone's interested:
Environment: