-
Notifications
You must be signed in to change notification settings - Fork 752
Closed
Description
Bug Description
When using manage_gameobject with action: set_component_property to modify array-type serialized fields on UdonSharp components, the operation fails with a paradoxical error:
Property 'menuNames' not found. Did you mean: menuNames?
The property clearly exists and is listed in the "Available" properties, but the setter logic fails to match it.
Reproduction Steps
- Have a GameObject with an UdonSharp component containing array fields (e.g.,
string[] menuNames) - Attempt to set the property via MCP:
{
"action": "set_component_property",
"target": "Shell",
"component_name": "DT_Shell",
"component_properties": {
"menuNames": { "value": ["STATS", "GITHUB", "DISCORD"] }
}
}- Observe the error in Unity console
Expected Behavior
The array property should be updated with the new values.
Actual Behavior
Operation fails with:
[ManageGameObject] Property 'menuNames' not found. Did you mean: menuNames? Available: [coreReference, DisableInteractive, enabled, hideFlags, inputKey, InteractionText, menuDescriptions, menuNames, menuTargets, menuTypes, name, rolesModule, runInEditMode, tag, useGUILayout]
Full Stack Trace
UnityEngine.Debug:LogWarning (object)
MCPForUnity.Editor.Tools.ManageGameObject:SetComponentPropertiesInternal (UnityEngine.GameObject,string,Newtonsoft.Json.Linq.JObject,UnityEngine.Component) (at ./Library/PackageCache/com.coplaydev.unity-mcp@7.0.0/Editor/Tools/ManageGameObject.cs:1685)
MCPForUnity.Editor.Tools.ManageGameObject:SetComponentPropertyOnTarget (Newtonsoft.Json.Linq.JObject,Newtonsoft.Json.Linq.JToken,string) (at ./Library/PackageCache/com.coplaydev.unity-mcp@7.0.0/Editor/Tools/ManageGameObject.cs:1244)
MCPForUnity.Editor.Tools.ManageGameObject:HandleCommand (Newtonsoft.Json.Linq.JObject) (at ./Library/PackageCache/com.coplaydev.unity-mcp@7.0.0/Editor/Tools/ManageGameObject.cs:191)
MCPForUnity.Editor.Tools.CommandRegistry:ExecuteCommand (string,Newtonsoft.Json.Linq.JObject,System.Threading.Tasks.TaskCompletionSource`1<string>) (at ./Library/PackageCache/com.coplaydev.unity-mcp@7.0.0/Editor/Tools/CommandRegistry.cs:248)
MCPForUnity.Editor.MCPForUnityBridge:ProcessCommands () (at ./Library/PackageCache/com.coplaydev.unity-mcp@7.0.0/Editor/MCPForUnityBridge.cs:954)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
Environment
- Unity MCP Package: v7.0.0
- Unity: 2022.3.22f1
- Component Type: UdonSharp (VRChat SDK)
- Property Types Tested:
string[],UdonSharpBehaviour[]
Analysis
The property name lookup succeeds (it appears in "Available" and in "Did you mean"), but the actual property setter fails. Likely causes:
- Array-type properties may not be supported by
SetComponentPropertiesInternal - UdonSharp components use Odin serialization which may require different reflection/access patterns
- The property matching logic in the setter differs from the property listing logic
Workaround
Currently editing the serialized YAML files (prefab/scene) directly or using Unity Inspector manually.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels