> For the complete documentation index, see [llms.txt](https://duddzy-scripts.gitbook.io/duddzy-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://duddzy-scripts.gitbook.io/duddzy-scripts-docs/scripts/duddzy-jail-3/camera-and-preview.md).

# Camera & Preview

DZ Customs includes a live preview camera system so players can clearly see vehicle changes before checkout.

The camera is configurable from:

```
dz_customs/shared/config.lua
```

***

### Camera Config

```lua
Config.Camera = {
    enabled = true,

    distance = 5.5,
    height = 1.8,

    rotationSpeed = 0.18,
    pitchSpeed = 0.035,
    zoomStep = 0.25,
    minZoom = 2.0,
    maxZoom = 9.0,

    transition = {
        enabled = true,
        duration = 650,
        easing = 'easeOutCubic'
    },

    presets = {}
}
```

***

### Enable or Disable Camera

Enable camera:

```lua
Config.Camera.enabled = true
```

Disable camera:

```lua
Config.Camera.enabled = false
```

Disabling the camera is not recommended because the UI is designed around live vehicle preview.

***

### Manual Camera Controls

Players can control the camera while the menu is open:

```
Hold Right Click + Drag = Rotate camera
Hold Right Click + Scroll = Zoom in/out
Double Right Click = Reset camera
```

***

### Camera Sensitivity

Rotation speed:

```lua
rotationSpeed = 0.18
```

Pitch speed:

```lua
pitchSpeed = 0.035
```

Lower values make camera movement slower.

Higher values make camera movement faster.

***

### Camera Zoom

```lua
minZoom = 2.0
maxZoom = 9.0
```

These values control how close or far the player can zoom.

***

### Smooth Camera Transitions

```lua
transition = {
    enabled = true,
    duration = 650,
    easing = 'easeOutCubic'
}
```

When enabled, the camera smoothly moves between category presets.

Disable smooth transitions:

```lua
transition = {
    enabled = false,
    duration = 650,
    easing = 'easeOutCubic'
}
```

***

### Category Camera Presets

Each category can have its own camera position.

Example:

```lua
presets = {
    wheels = {
        headingOffset = 95.0,
        distance = 3.2,
        height = 0.65,
        pitch = 2.0
    },

    lights = {
        headingOffset = 0.0,
        distance = 3.8,
        height = 0.85,
        pitch = 2.0
    }
}
```

***

### Preset Values

#### headingOffset

The camera heading relative to the vehicle.

```lua
headingOffset = 95.0
```

#### distance

How far the camera is from the vehicle.

```lua
distance = 3.2
```

#### height

How high the camera is.

```lua
height = 0.65
```

#### pitch

Camera pitch value.

```lua
pitch = 2.0
```

***

### Recommended Presets

Wheels:

```lua
wheels = {
    headingOffset = 95.0,
    distance = 3.2,
    height = 0.65,
    pitch = 2.0
}
```

Lights:

```lua
lights = {
    headingOffset = 0.0,
    distance = 3.8,
    height = 0.85,
    pitch = 2.0
}
```

Paint:

```lua
paint = {
    headingOffset = 45.0,
    distance = 6.2,
    height = 1.65,
    pitch = 7.0
}
```

Plates:

```lua
plates = {
    headingOffset = 180.0,
    distance = 3.4,
    height = 0.7,
    pitch = 2.0
}
```

***

## Preview Effects

DZ Customs previews most customisations live on the current vehicle before checkout.

If the player cancels, the vehicle is restored to its original state.

If the player completes checkout, the selected customisations remain applied.

***

### Vehicle Restore

When the shop opens, DZ Customs stores the original vehicle state.

If the player cancels:

```
Original vehicle properties are restored.
```

If checkout succeeds:

```
Current vehicle properties are kept and saved if persistence is enabled.
```

***

### Headlight Preview

When selecting xenon headlights or headlight colours, the script turns the vehicle lights on so the player can see the colour change.

***

### Neon Preview

When selecting neon underglow or neon colours, the script turns on the neon lights so the player can preview the colour.

***

### Tyre Smoke Preview

Tyre smoke colour can be hard to see while stationary, so DZ Customs includes an optional burnout preview.

```lua
Config.Preview = {
    tyreSmokeBurnout = {
        enabled = true,
        duration = 2500,
        forceEngineOn = true,
        temporarilyUnfreezeVehicle = true,
        refreezeAfterPreview = true
    }
}
```

***

### Tyre Smoke Burnout Settings

Enable or disable the burnout preview:

```lua
enabled = true
```

Duration in milliseconds:

```lua
duration = 2500
```

Force engine on during preview:

```lua
forceEngineOn = true
```

Temporarily unfreeze vehicle so tyre smoke renders correctly:

```lua
temporarilyUnfreezeVehicle = true
```

Refreeze the vehicle after the preview:

```lua
refreezeAfterPreview = true
```

***

### Preview Troubleshooting

#### Vehicle moves during tyre smoke preview

Reduce the duration:

```lua
duration = 1500
```

Make sure this is enabled:

```lua
refreezeAfterPreview = true
```

***

#### Tyre smoke is not visible

Some smoke colours are difficult to see depending on lighting and road surface.

Pure black can appear almost invisible.

Use a dark grey instead:

```lua
{ value = { r = 45, g = 45, b = 45 }, label = 'Black' }
```

***

#### Lights do not appear to change

Make sure the vehicle supports xenon/headlight colour changes.

Some vehicles may not show every lighting option clearly.
