> For the complete documentation index, see [llms.txt](https://docs.meshifai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meshifai.com/unity-engine/scripting-api/quick-start.md).

# 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 %}
