0

I am trying to override this function. But those are the errors I get when I use them as I saw in some tutorials:

Here

The error messages are

"Using directive is unnecessary"

(for the error in line 3) and

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

(for the error in line 7).

The function that the autocomplete generates for me is as follows:

Here

The version details are: Unity 2021.1.19f1 and MLAgents version

I'll appreciate any help.

Thanks

derHugo
  • 83,094
  • 9
  • 75
  • 115
  • Welcome to Stack Overflow. [Please don't post screenshots of text](https://meta.stackoverflow.com/a/285557/354577). They can't be searched or copied, or even consumed by users of adaptive technologies like screen readers. Instead, paste the code as text directly into your question. If you select it and click the `{}` button or Ctrl+K the code block will be indented by four spaces, which will cause it to be rendered as code. – ChrisGPT was on strike Dec 11 '21 at 03:35

2 Answers2

0

Just fixed the same issue. You have probably installed an older version of ML Agents in the package manager. Just get back in the package manager by:

Window > Package Manager

Make sure you are visualizing Unity Registry Packages and search for ML Agents. Expand the field and search for at least the 1.4.0 version of the package. This version will allow you to use OnActionReceived(ActionBuffers actions).

  • Thanks, man, I tried to do what you said but I couldn't find any version different than mine (1.0.8). Do you know how can I update my version? – Itai Kaplan Dec 07 '21 at 20:34
  • Are you sure you don't have the "See other versions" option when you expand ML Agents? – giovanni13696 Dec 08 '21 at 16:10
  • Yeah, I don't have it. I saw this tutorial: https://www.youtube.com/watch?v=9PAQbY2BJ_M But when I go to the package manager I don't have the option of "enable preview packeges" So no I still don't see the" see other versions" option... thanks a lot for your help! – Itai Kaplan Dec 08 '21 at 16:39
-1

The problem was solved after reading the Advanced Installation part on the documentation here: https://docs.unity3d.com/Packages/com.unity.ml-agents@2.1/manual/index.html

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 11 '21 at 22:06