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.
Starts the generation of a new 3D mesh from a text prompt and returns
unique IDs used to track and retrieve the result. Must be called from
server scripts. You can optionally receive intermediate results, such as
the untextured mesh, by providing an intermediateResultCallback
function.
After the generation is complete, use
LoadGeneratedMeshAsync()
to load and display the generated mesh.
Error Codes
Error
Description
Recommended action
Rate limit exceeded
The maximum number of mesh generations has been exceeded for the minute.
Wait until the rate limit resets.
Moderation failed
The mesh generation was flagged for moderation.
Review and modify the prompt to ensure it adheres to Roblox's moderation guidelines.
Internal server error
An unexpected issue occurred on the server.
Retry the request later or check server status for issues.
Character limit exceeded
The input prompt length for this generation request exceeded the limit.
Reduce the number of characters in the Prompt string of the input dictionary.
Service overloaded
The service is overloaded.
Retry the request later.
Size dimensions must all be greater than 0
Invalid size provided.
Change the size to above 0.
This function yields. It will block the calling thread until completion.
Enables generation of multi-mesh geometries according to provided inputs
and a schema.
This method throws an error during the generation process for issues like
prompt rejection, generation timeouts, schema mismatches, or backend
service errors. It's recommended to wrap it in a
pcall() to catch such errors.
See this guide for more detailed
examples including usage of a Behaviors module to connect functional
behaviors to generated models.
This function yields. It will block the calling thread until completion.
Retrieves and loads a mesh generated by
GenerateMeshAsync() using
the provided generationId. Must be called from client scripts.
The mesh can be returned as a MeshPart or Model. Because
editable meshes are not replicated, the loaded mesh is not replicated to
any other clients and can only be loaded once per generationId.
This function yields. It will block the calling thread until completion.