{"record":{"id":"5d61ddb5277118d8","repo":"CoplayDev/unity-mcp","slug":"gameobject-go-name-does-not-have-a-probuilderm","errorCode":null,"errorMessage":"GameObject '{go.name}' does not have a ProBuilderMesh component.","messagePattern":"GameObject '(.+?)' does not have a ProBuilderMesh component\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"MCPForUnity/Editor/Tools/ProBuilder/ManageProBuilder.cs","lineNumber":283,"sourceCode":"\n        internal static GameObject FindTarget(JObject @params)\n        {\n            return ObjectResolver.ResolveGameObject(@params[\"target\"], @params[\"searchMethod\"]?.ToString());\n        }\n\n        private static Component GetProBuilderMesh(GameObject go)\n        {\n            return go.GetComponent(_proBuilderMeshType);\n        }\n\n        internal static Component RequireProBuilderMesh(JObject @params)\n        {\n            var go = FindTarget(@params);\n            if (go == null)\n                throw new Exception(\"Target GameObject not found.\");\n            var pbMesh = GetProBuilderMesh(go);\n            if (pbMesh == null)\n                throw new Exception($\"GameObject '{go.name}' does not have a ProBuilderMesh component.\");\n            return pbMesh;\n        }\n\n        internal static void RefreshMesh(Component pbMesh)\n        {\n            // ToMesh and Refresh have optional parameters (MeshTopology, RefreshMask) —\n            // Type.EmptyTypes won't find them. Use name-only lookup with default args.\n            var toMeshMethod = _proBuilderMeshType.GetMethod(\"ToMesh\", Type.EmptyTypes)\n                ?? _proBuilderMeshType.GetMethod(\"ToMesh\", BindingFlags.Instance | BindingFlags.Public);\n            toMeshMethod?.Invoke(pbMesh, toMeshMethod.GetParameters().Length > 0\n                ? new object[toMeshMethod.GetParameters().Length]\n                : null);\n\n            var refreshMethod = _proBuilderMeshType.GetMethod(\"Refresh\", Type.EmptyTypes)\n                ?? _proBuilderMeshType.GetMethod(\"Refresh\", BindingFlags.Instance | BindingFlags.Public);\n            refreshMethod?.Invoke(pbMesh, refreshMethod.GetParameters().Length > 0\n                ? new object[refreshMethod.GetParameters().Length]\n                : null);","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/MCPForUnity/Editor/Tools/ProBuilder/ManageProBuilder.cs#L265-L301","documentation":"Thrown by RequireProBuilderMesh when the target GameObject was found but does not have a ProBuilderMesh component. The tool uses reflection (GetComponent against _proBuilderMeshType) to locate the component, so the object must be an actual ProBuilder shape, not a standard Unity primitive or mesh.","triggerScenarios":"Calling a ProBuilder tool (bevel, extrude, set_material, etc.) on a standard Unity primitive (GameObject.CreatePrimitive), a custom mesh object, or a GameObject that has never been ProBuilder-ized. Also if the ProBuilder package is installed but the object was created without ProBuilder APIs.","commonSituations":"AI creates a GameObject via manage_gameobject (not ProBuilder) then tries to run ProBuilder operations on it; converting a standard mesh to ProBuilder was skipped; the ProBuilder package version exposes a different component type name.","solutions":["Create the shape using the ProBuilder create_shape tool so it gets a ProBuilderMesh component.","Use ProBuilder's 'ProBuilderize' (or the tool's conversion action if available) to add a ProBuilderMesh to an existing mesh.","Verify with read_components that a ProBuilderMesh is attached before calling mesh-editing operations.","If the object is a standard primitive, replace it with a ProBuilder shape of the same type."],"exampleFix":"// before: GameObject created via manage_gameobject\n// then calling: manage_probuilder bevel on it\n// after: create via ProBuilder first\nparams = {\"action\": \"create\", \"shapeType\": \"Cube\", \"name\": \"MyShape\"}","handlingStrategy":"validation","validationCode":"# Before calling ProBuilder mesh operations, verify the component exists\n# Use read_components on the target and check for a ProBuilderMesh\ndef has_probuilder_mesh(components):\n    return any(c.get('type') == 'ProBuilderMesh' for c in components)","typeGuard":null,"tryCatchPattern":"try\n{\n    var mesh = RequireProBuilderMesh(@params);\n}\ncatch (Exception ex) when (ex.Message.Contains(\"does not have a ProBuilderMesh\"))\n{\n    return new ErrorResponse($\"Target is not a ProBuilder shape. Create it via create_shape first.\");\n}","preventionTips":["Always create geometry via ProBuilder's create_shape when you intend to use ProBuilder tools.","Check component presence with read_components before mesh-editing operations.","Do not mix standard primitives with ProBuilder workflows.","After ProBuilderize operations, verify the ProBuilderMesh was added successfully."],"tags":["probuilder","component","missing-component","mesh","reflection"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}