尝试将 OnActionReceived(ActionBuffers 动作)与 MLAgents 一起用于 Unity

Trying to use OnActionReceived(ActionBuffers action) with MLAgents for Unity

我正在尝试覆盖此功能。但这些是我在使用它们时遇到的错误,正如我在一些教程中看到的那样:

错误信息是

"Using directive is unnecessary"

(针对第3行的错误)和

"The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?)"

(针对第7行的错误)

自动完成为我生成的函数如下:

版本详情如下: Unity 2021.1.19f1 和 MLAgents 版本

如有任何帮助,我将不胜感激。

谢谢

刚刚解决了同样的问题。您可能在包管理器中安装了旧版本的 ML 代理。通过以下方式返回包管理器:

Window > 包管理器

确保您正在可视化 Unity 注册表包并搜索 ML 代理。展开字段并搜索至少 1.4.0 版本的包。此版本将允许您使用 OnActionReceived(ActionBuffers actions).

阅读文档中的高级安装部分后问题已解决: https://docs.unity3d.com/Packages/com.unity.ml-agents@2.1/manual/index.html