Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Cannot use ml-agents in my own game, missing assembly?

Discussion in 'ML-Agents' started by unity_Hr4RzFBKibQ_Tw, Aug 12, 2021.

  1. unity_Hr4RzFBKibQ_Tw

    unity_Hr4RzFBKibQ_Tw

    Joined:
    Mar 10, 2021
    Posts:
    1
    Hello,
    I have followed the installation instructions from Github, downloaded ml-agents-release_18 and installed from disk using the package manager.

    I get the following errors:
    Assets\Scripts\Tank\TankMovement.cs(3,13): error CS0234: The type or namespace name 'MLAgents' does not exist in the namespace 'Unity' (are you missing an assembly reference?)
    Assets\Scripts\Tank\TankMovement.cs(5,29): error CS0246: The type or namespace name 'Agent' could not be found (are you missing a using directive or an assembly reference?)

    Do I need to copy any files somewhere?

    Thanks
     
  2. mahon123

    mahon123

    Unity Technologies

    Joined:
    Feb 9, 2021
    Posts:
    13
    Hi ,
    It worth double checking the path you're using to be
    ml-agents-release_xx/com.unity.ml-agents/package.json
    and that you see `ML Agents` under packages in the project.

    Otherwise, can you provide more information like:
    • what version of unity are you using
    • what operating system are you on and what version
    • any other additional information about your installation process
    It is easier to diagnose issues like this with more information.
    Thanks,
     
  3. ruoping_unity

    ruoping_unity

    Unity Technologies

    Joined:
    Jul 10, 2020
    Posts:
    134
    If you're using assembly definition (.asmdef file), you need to add mlagents there. The error message is saying it's missing the assembly to reference the package.