You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for developing this amazing tool! It has been incredibly helpful in my project. However, I encountered some issues during its usage.
When using Cursor (0.47.8) in Unity 2022.3.55 to instruct the Agent to implement an airplane battle game, executing multiple scripts results in compilation errors. The error messages indicate that predefined types from mscorlib.dll are being defined multiple times. For example, this issue frequently occurs when adding script components to GameObjects or in many other scenarios.
{
"code": "var player = GameObject.Find(\"Player\");\nplayer.AddComponent<SpriteRenderer>();\nplayer.AddComponent<BoxCollider2D>().isTrigger = true;\nplayer.AddComponent<PlayerController>();\nDebug.Log(\"Added components to player object\");"
}
//Error Info
Failed to execute editor command: Failed to execute command: Compilation failed: The predefined type `System.Object' is defined multiple times. Using definition from `mscorlib.dll' The predefined type `System.ValueType' is defined multiple times. Using definition from `mscorlib.dll' The predefined type `System.Attribute' is defined multiple times. Using definition from `mscorlib.dll' ... The type or namespace name `BoxCollider2D' could not be found. Are you missing an assembly reference?
// Attempt to comment out the codepublicclassUnityMCPConnection{
....
// options.ReferencedAssemblies.Add(typeof(object).Assembly.Location); // Add mscorlib
....
}
//Error Info
[UnityMCP] Failed to execute editor command: Failed to execute command: Compilation failed:\nThe type or namespace name `UI' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?
Explanation:
I tried following the solution referenced in #14 , which suggested commenting out the line that adds mscorlib.dll reference. However, when I comment out the code, I encounter an error indicating that certain namespaces (such as UI) are missing, implying that required references are not found. On the other hand, when I don't comment out the code, I get compilation errors related to multiple definitions of types from mscorlib.dll.
Environment Information:
Unity Version: 2022.3.55
Node.js Version: v22.14.0
NPM Version: 10.9.2
Operating System: Windows
Attempted Solutions (Did Not Work):
Switched API Compatibility Level between .NET Framework and .NET Standard.
Change Scripting Backend to IL2CPP.
Deleted the Library and Temp folders from the project directory.
Tried different Unity versions, including 2022.3.55 and Unity 6.0.17.
The Agent should be able to successfully execute the scripts without encountering mscorlib.dll conflicts, and components should be successfully added. I would appreciate any suggestions or guidance on how to resolve this issue!
Description:
First of all, thank you for developing this amazing tool! It has been incredibly helpful in my project. However, I encountered some issues during its usage.
When using Cursor (0.47.8) in Unity 2022.3.55 to instruct the Agent to implement an airplane battle game, executing multiple scripts results in compilation errors. The error messages indicate that predefined types from
mscorlib.dllare being defined multiple times.For example, this issue frequently occurs when adding script components to GameObjects or in many other scenarios.
Error Examples:
{ "code": "var player = GameObject.Find(\"Player\");\nplayer.AddComponent<SpriteRenderer>();\nplayer.AddComponent<BoxCollider2D>().isTrigger = true;\nplayer.AddComponent<PlayerController>();\nDebug.Log(\"Added components to player object\");" }{ "code": "var scoreText = GameObject.Find(\"UIManager/Canvas/GameplayPanel/ScoreText\");\nif (scoreText != null) {\n var text = scoreText.AddComponent<TMPro.TextMeshProUGUI>();\n text.text = \"Score: 0\";\n text.fontSize = 36;\n text.alignment = TMPro.TextAlignment.Left;\n Debug.Log(\"ScoreText TMP component added successfully\");\n} else {\n Debug.LogError(\"Could not find ScoreText object\");\n}" }Explanation:
I tried following the solution referenced in #14 , which suggested commenting out the line that adds
mscorlib.dllreference. However, when I comment out the code, I encounter an error indicating that certain namespaces (such asUI) are missing, implying that required references are not found. On the other hand, when I don't comment out the code, I get compilation errors related to multiple definitions of types frommscorlib.dll.Environment Information:
Attempted Solutions (Did Not Work):
.NET Frameworkand.NET Standard.IL2CPP.LibraryandTempfolders from the project directory.2022.3.55andUnity 6.0.17.Expected Behavior:
The Agent should be able to successfully execute the scripts without encountering
mscorlib.dllconflicts, and components should be successfully added. I would appreciate any suggestions or guidance on how to resolve this issue!