> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liv.tv/llms.txt
> Use this file to discover all available pages before exploring further.

# Spawning

> How to spawn and integrate the LIV Camera Kit (LCK) virtual tablet into your Unreal Engine VR game, including static placement, controller summon, hand gesture, and menu integration patterns.

## Introduction

How you spawn the camera tablet significantly impacts player engagement. The best integrations make the tablet feel *native* to your game — something that belongs naturally in your world rather than an external tool.

<Tip>
  Games using in-game object spawning see **5x more camera activity** and videos created compared to menu-based spawning.
</Tip>

***

## Spawning Methods

### In-Game Object (Recommended)

Place the tablet spawn directly in the game scene rather than hiding it behind menus.

**Benefits:**

* Players discover it naturally
* Always visible and accessible
* Feels like part of the game world
* Maximum engagement

**Implementation:**

```cpp theme={null}
UCLASS()
class ATabletSpawner : public AActor
{
    GENERATED_BODY()

public:
    UPROPERTY(EditAnywhere)
    TSubclassOf<ALCKTablet> TabletClass;

    UPROPERTY(EditAnywhere)
    UStaticMeshComponent* SpawnerMesh;

protected:
    virtual void BeginPlay() override
    {
        Super::BeginPlay();

        // Spawn tablet at predetermined location
        ALCKTablet* Tablet = GetWorld()->SpawnActor<ALCKTablet>(
            TabletClass,
            SpawnTransform
        );

        // Parent to spawner for organized scene
        Tablet->AttachToActor(this, FAttachmentTransformRules::KeepWorldTransform);
    }
};
```

***

## Real-World Examples

<CardGroup cols={2}>
  <Card title="Gorilla Tag" icon="hand-back-fist">
    **Integration Style:** Wall-mounted spawner

    The tablet is placed on a wall near the cosmetics station. Players pull it directly from the wall. The design matches the game's unique art style.

    **Key Takeaways:**

    * Strategic placement near popular areas
    * Art style matches game aesthetic
    * Natural grab interaction
  </Card>

  <Card title="UNDERDOGS" icon="robot">
    **Integration Style:** Mech cockpit integration

    The tablet is integrated into the mech UI. It feels like a custom-built tool for the game world, allowing players to stay immersed while creating content.

    **Key Takeaways:**

    * Deep integration with game UI
    * Thematic customization
    * Immersion preserved
  </Card>
</CardGroup>

***

## Spawning Patterns

<Tabs>
  <Tab title="Static Placement">
    ### Static World Placement

    Place the tablet at fixed locations in your game world.

    ```cpp theme={null}
    // Place in level blueprint or spawner actor
    void ALevelBlueprint::BeginPlay()
    {
        FVector SpawnLocation = GetTabletSpawnPoint();
        FRotator SpawnRotation = GetTabletSpawnRotation();

        GetWorld()->SpawnActor<ALCKTablet>(
            TabletClass,
            SpawnLocation,
            SpawnRotation
        );
    }
    ```

    **Best For:**

    * Lobby/hub areas
    * Menu rooms
    * Consistent spawn points
  </Tab>

  <Tab title="Controller Summon">
    ### Controller Button Summon

    Spawn the tablet with a controller button press.

    ```cpp theme={null}
    void AMyPlayerController::OnSummonTabletPressed()
    {
        if (SpawnedTablet)
        {
            // Toggle visibility or destroy
            SpawnedTablet->SetActorHiddenInGame(
                !SpawnedTablet->IsHidden()
            );
            return;
        }

        // Spawn in front of player
        FVector SpawnLoc = GetPawn()->GetActorLocation() +
                          GetPawn()->GetActorForwardVector() * 100.0f;

        SpawnedTablet = GetWorld()->SpawnActor<ALCKTablet>(
            TabletClass,
            SpawnLoc,
            GetControlRotation()
        );
    }
    ```

    **Best For:**

    * Games with limited UI space
    * Action-heavy games
    * Quick access needs
  </Tab>

  <Tab title="Hand Gesture">
    ### Hand Gesture Spawning

    Detect a specific hand gesture to spawn the tablet.

    ```cpp theme={null}
    void AHandTracker::OnGestureDetected(EHandGesture Gesture)
    {
        if (Gesture == EHandGesture::ThumbsUp)
        {
            // Spawn tablet at gesture hand location
            FVector HandLocation = GetHandLocation(EControllerHand::Left);

            GetWorld()->SpawnActor<ALCKTablet>(
                TabletClass,
                HandLocation,
                FRotator::ZeroRotator
            );
        }
    }
    ```

    **Best For:**

    * Hand tracking games
    * Immersive experiences
    * No-controller scenarios
  </Tab>

  <Tab title="Menu Integration">
    ### Game Menu Integration

    Add tablet spawning to your game's pause or settings menu.

    ```cpp theme={null}
    void UGameMenuWidget::OnSpawnCameraPressed()
    {
        // Close menu first
        SetVisibility(ESlateVisibility::Hidden);

        // Spawn tablet
        if (APlayerController* PC = GetOwningPlayer())
        {
            FVector SpawnLoc = PC->GetPawn()->GetActorLocation() +
                              FVector(0, 0, 50);

            PC->GetWorld()->SpawnActor<ALCKTablet>(
                TabletClass,
                SpawnLoc,
                FRotator::ZeroRotator
            );
        }
    }
    ```

    **Best For:**

    * Games with existing menu systems
    * Settings integration
    * Optional feature exposure
  </Tab>
</Tabs>

***

## Customizing Tablet Appearance

Make the tablet match your game's art direction:

<AccordionGroup>
  <Accordion title="Replace Tablet Mesh" icon="cube">
    Create a custom tablet mesh that fits your game:

    ```cpp theme={null}
    // In your custom tablet blueprint or subclass
    UPROPERTY(EditAnywhere, Category = "Appearance")
    UStaticMesh* CustomTabletMesh;

    void AMyCustomTablet::BeginPlay()
    {
        Super::BeginPlay();

        // Replace default mesh
        TabletMeshComponent->SetStaticMesh(CustomTabletMesh);
    }
    ```
  </Accordion>

  <Accordion title="Add Decorative Elements" icon="star">
    Add game-themed decorations:

    ```cpp theme={null}
    // Steampunk camera example
    UPROPERTY(EditAnywhere)
    UStaticMesh* GearsMesh;

    UPROPERTY(EditAnywhere)
    UStaticMesh* BrassTrimMesh;

    void AMyCustomTablet::BeginPlay()
    {
        // Add decorative meshes
        AddDecorationMesh(GearsMesh, FVector(0, 0, 10));
        AddDecorationMesh(BrassTrimMesh, FVector(0, 5, 0));
    }
    ```
  </Accordion>

  <Accordion title="Themed Materials" icon="palette">
    Apply themed materials to the tablet:

    ```cpp theme={null}
    // Load and apply custom materials
    UMaterialInstance* ThemeMaterial = LoadObject<UMaterialInstance>(
        nullptr,
        TEXT("/Game/Materials/MI_Tablet_Steampunk")
    );

    TabletMeshComponent->SetMaterial(0, ThemeMaterial);
    ```
  </Accordion>
</AccordionGroup>

***

## What Doesn't Work

<Warning>
  Avoid these common mistakes that reduce camera usage:
</Warning>

| Approach                         | Problem                        |
| -------------------------------- | ------------------------------ |
| Hidden in submenus               | Players never find it          |
| Spawn only in specific locations | Limits when players can record |
| Complex gesture requirements     | Frustrating to activate        |
| Tiny spawn button                | Hard to interact with          |
| No visual indication             | Players don't know it exists   |

***

## Communication

Once you've decided on your spawning method, communicate it clearly to players:

1. **In-game tutorial** — Show how to access the camera
2. **Visual indicator** — Make the spawn point obvious
3. **Loading screen tips** — Remind players about the feature
4. **Menu option** — Include in settings even if not primary method

***

## Event-Based Spawning

For games where the camera should only be available at certain times:

```cpp theme={null}
void AGameMode::OnBattleComplete()
{
    // Spawn camera for replay capture
    FVector ReplaySpawnLoc = GetReplaySpawnLocation();

    ALCKTablet* Tablet = GetWorld()->SpawnActor<ALCKTablet>(
        TabletClass,
        ReplaySpawnLoc,
        FRotator::ZeroRotator
    );

    // Auto-destroy after period
    Tablet->SetLifeSpan(120.0f);  // 2 minutes
}
```

<Note>
  While event-based spawning can be fun, it shouldn't be the ONLY way to access the camera. For maximum engagement, the camera should be available anywhere, anytime.
</Note>

***

## See Also

<CardGroup cols={2}>
  <Card title="Integration" icon="plug" href="/unreal/tablet-interface/integration">
    Lifecycle management
  </Card>

  <Card title="Customization" icon="palette" href="/unreal/tablet-customization/customization">
    Customize tablet appearance
  </Card>
</CardGroup>
