# Quick Start

## <kbd>Quick Start Guide</kbd>&#x20;

Getting started with the MeshifAI Scripting API is simply and easy to use. Let's dive into using it below.

### <kbd>Basic Usage</kbd>

Here's a simple example to generate a 3D model from a text description:

```csharp
using UnityEngine;
using MeshifAI.Core;

public class QuickStartExample : MonoBehaviour
{
    private void Start()
    {
        // Generate a model with a simple description
        Meshifai.GenerateModel(
            "A futuristic spaceship",
            OnModelGenerated
        );
    }
    
    private void OnModelGenerated(GameObject model)
    {
        // Position the model in your scene
        model.transform.SetParent(transform);
        model.transform.localPosition = Vector3.zero;
        
        // That's it! Your AI-generated model is ready to use
        Debug.Log("Model generated successfully!");
    }
}
```

### <kbd>Adding Error Handling</kbd>

For more robust implementation, add error handling:

```csharp
Meshifai.GenerateModel(
    "A medieval castle",
    OnModelGenerated,
    OnGenerationError
);

private void OnGenerationError(string errorMessage)
{
    Debug.LogError($"Generation failed: {errorMessage}");
}
```

### <kbd>Showing Progress Updates</kbd>

Keep your users informed with progress updates:

```csharp
Meshifai.GenerateModel(
    "A fantasy sword",
    OnModelGenerated,
    OnGenerationError,
    OnGenerationStatus
);

private void OnGenerationStatus(string status, float progress)
{
    // Update your UI with the current generation status
    Debug.Log($"{status} - {progress:P0} complete");
}
```

### <kbd>Accessing Model Metadata</kbd>

Each generated model includes metadata about how it was created:

```csharp
private void OnModelGenerated(GameObject model)
{
    // Get the generation data component
    ModelGenerationData data = model.GetComponent<ModelGenerationData>();
    
    // Access generation parameters
    Debug.Log($"Model prompt: {data.Prompt}");
    Debug.Log($"Model variance: {data.Variance}");
    Debug.Log($"Generated at: {data.GenerationTime}");
}
```

Now that you have a general understanding, you're ready to dive into the world of 3D Model generation. \
\
We look forward to see what you choose to build with it.

{% hint style="info" %}
Need Support? Feel free to reach out to us over `hello@0xretro.dev` or twitter on `@0xretrodev`
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.meshifai.com/unity-engine/scripting-api/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
