Repository navigation
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/[email protected]/Editor/Tools/ManageGameObject.cs:1685)
MCPForUnity.Editor.Tools.ManageGameObject:SetComponentPropertyOnTarget (Newtonsoft.Json.Linq.JObject,Newtonsoft.Json.Linq.JToken,string) (at ./Library/PackageCache/[email protected]/Editor/Tools/ManageGameObject.cs:1244)
MCPForUnity.Editor.Tools.ManageGameObject:HandleCommand (Newtonsoft.Json.Linq.JObject) (at ./Library/PackageCache/[email protected]/Editor/Tools/ManageGameObject.cs:191)
MCPForUnity.Editor.Tools.CommandRegistry:ExecuteCommand (string,Newtonsoft.Json.Linq.JObject,System.Threading.Tasks.TaskCompletionSource`1<string>) (at ./Library/PackageCache/[email protected]/Editor/Tools/CommandRegistry.cs:248)
MCPForUnity.Editor.MCPForUnityBridge:ProcessCommands () (at ./Library/PackageCache/[email protected]/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.
Metadata
Metadata
Assignees
Labels
No labels
Activity
CloudStrife7 commentedon Feb 17, 2026
Additional Error Logs
The error occurs for each array property attempted. Here are the full console outputs:
Key Observation
The error message is self-contradictory:
The property lookup for "Did you mean" suggestions works, but the actual property setter fails on the same property name.
Root Cause Theory
Looking at line 1685 in
ManageGameObject.cs, theSetComponentPropertiesInternalmethod likely:SerializedProperty.arraySizeand element-by-element assignment)Suggested Fix
In
SetComponentPropertiesInternal, add support for array properties by:SerializedPropertyarray APIs:arraySize,GetArrayElementAtIndex(), etc.Current Workarounds
[MenuItem]to expose array modification operationsFix misleading 'Property not found' error for conversion failures and…
Fix misleading 'Property not found' error and add SerializedProperty …
dsarno commentedon Feb 17, 2026
Thanks for the detailed report @CloudStrife7 — this was a great catch. The paradoxical "not found / did you mean: [exact same name]" error was definitely confusing.
Fixed in PR #766 (merged to beta). The fix will be available in the next beta release after
9.4.7-beta.3. Summary of changes:SerializedPropertyfallback so array properties that reflection can't handle are set via Unity's serialization systemFix misleading 'Property not found' error and add SerializedProperty …
Fix misleading 'Property not found' error and add SerializedProperty …