Service · inherits Instance
GenerationService
Service that allows developers to generate 3D objects from text prompts.
About GenerationService
GenerationService enables you to generate 3D objects from text prompts using
Roblox's Cube 3D foundation model. This enables the generation of objects like
environmental props in-experience, as well as fully functional models like
vehicles that drive, planes that fly, and weapons that shoot.
Methods 3
GenerateModelAsync
(inputs: Dictionary, schema: Dictionary, options: Dictionary?) → TupleYieldsEnables generation of multi-mesh geometries according to providedinputsand aschema.Enables generation of multi-mesh geometries according to provided
inputsand aschema.Provide creative direction through
inputs: aTextPrompt, anImageto condition on visually, or both. Control the output structure throughschema, supplying either a built-inPredefinedSchemaor a customSchemaDefinitionthat names the parts to produce.This method throws an error during the generation process for issues like prompt rejection, generation timeouts,
schemamismatches, or backend service errors. It's recommended to wrap it in aLuaGlobals.pcallto catch such errors.See this guide for more detailed examples including usage of a
Behaviorsmodule to connect functional behaviors to generated models.LoadGeneratedMeshAsync
(generationId: string) → MeshPartYieldsRetrieves and loads a mesh generated byGenerationService.GenerateMeshAsyncusing the providedgenerationId.Retrieves and loads a mesh generated by
GenerateMeshAsync()using the providedgenerationId. Must be called from client scripts.The mesh can be returned as a
MeshPartorModel. Because editable meshes are not replicated, the loaded mesh is not replicated to any other clients and can only be loaded once pergenerationId.SegmentMeshAsync
(meshPart: MeshPart, schema: Dictionary, options: Dictionary?) → TupleYieldsSegments an existingMeshPartinto multiple named parts according to a provided schema, returning aModelorganized by the schema groups.Segments an existing
MeshPartinto multiple named parts according to a provided schema and returns aModelwith the segmented parts organized by the schema groups.The
schemaparameter accepts the same structure asGenerateModelAsync(): either aPredefinedSchemastring (such as"Car5"for a five-part vehicle chassis or"Body1"for a single-mesh output) or aSchemaDefinitiontable with aGroupsarray of custom part names.This method can only be called from Roblox Studio (edit mode or plugin context). For published mesh assets, the caller must have edit permission for the asset. Wrap calls in
LuaGlobals.pcallto handle errors such as permission failures or mesh export issues.
GenerationService also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.