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

# DT POI and panels

> POIManager, follow targets, and panel handlers for machine detail UX.

**Scripts:**

* `Assets/_MolcaDT/Code/Scripts/POI/POIManager.cs`
* `Assets/_MolcaDT/Code/Scripts/POI/POIFollowTarget.cs`
* `Assets/_MolcaDT/Code/Scripts/Handler/Panel Handler/*`

## When to use

Use this page when wiring machine selection UX: screen/world POI indicators, camera follow behavior, and right/side panel detail presentation.

## POI layer

`POIManager` is a central runtime controller:

* Spawns/updates `POIHandler` UI items
* Tracks follow targets and offscreen behavior
* Applies overlap/stacking rules and layout padding

Common fields to tune in Inspector: `poiHandlerParent`, `poiHandlerPrefab`, offscreen mode, stacking/padding parameters.

## Panel handler layer

Handlers under `Handler/Panel Handler/` split machine detail concerns:

* Overview/Data panels (`OverviewPanelHandler`, `DataPanelHandler`)
* Working order flows (`WorkingOrder*`)
* Documentation/info/config children panel handlers

These are usually orchestrated by selection handlers and manager events rather than VR step logic.

## Code

**Singleton + layout** — **`POIManager`** (execution order **2000**) expects **`CameraController.instance`** for world→screen projection and **`poiHandlerParent`** as a **`RectTransform`** canvas area. **`InstantiatePOIButton`** spawns from **`poiHandlerPrefab`** (or an override prefab) and optional **`Action<POIHandler>`** after creation; **`ChangePOIButton(POIType)`** hides all managed cards then drives **`PlantManager`** machines’ POI mode; **`SelectPOIButton(List<MachineInfo>)`** filters selectable machines, derives **`POIType`** from **`LevelData`**, and invokes **`FactoryMenuManager.InvokePOIButton`**.

**Handler** — Each **`POIHandler`** pairs with **`POIFollowTarget`** on the same object, resolves **`MachineInfo`**, and toggles label/overview panels. **`POIFollowTarget`** drives world anchor position; **`POIManager.LateUpdate`** runs overlap resolution when **`allowStacking`** is false.

```csharp theme={null}
using MolcaDT.POI;
using System.Collections;
using UnityEngine;

public class SpawnPoiCard : MonoBehaviour
{
    public void AddCard()
    {
        StartCoroutine(POIManager.instance.InstantiatePOIButton(handler =>
        {
            // Configure handler / MachineInfo on the new instance
        }));
    }
}
```

```csharp theme={null}
using MolcaDT.Handler;
using MolcaDT.POI;
using System.Collections.Generic;

public static class PoiMode
{
    public static void ShowOverviewFor(List<MachineInfo> machines) =>
        POIManager.instance.SelectPOIButton(machines);

    public static void SetGlobalPoiType(POIType type) =>
        POIManager.instance.ChangePOIButton(type);
}
```

## Troubleshooting

* **Null ref in `POIManager.Awake`** — **`CameraController.instance`** and **`poiHandlerParent`** must exist in the loaded scene; POI manager typically lives under the same UI hierarchy as the twin camera rig.
* **POIs not visible** — Confirm **`POIFollowTarget`** components are active, **`MachineInfo`** / **`ObjectReference`** wiring matches selection flow, and canvas render mode works with **`CameraController`**’s camera.
* **Heavy overlap or jitter** — Increase **`itemPadding`**, **`resolveIterations`**, or enable **`allowStacking`**; switch **`cardOffscreenMode`** between **ClampToCanvasEdges** and **HideWhenOffscreen** per UX.
* **Overview empty** — Same as mapping: **[network layer](/dt/network-and-mapping)** must deliver **`ParameterDatum`** lists into **`OverviewPanelHandler`** / **`DataPanelHandler`** after **`MachineInfo`** selection.
* **Duplicate `POIManager`** — Second instance \*\*`Destroy`\*\*s itself; keep a single manager in the DT bootstrap scene.

## Related

* [DT startup flow](/dt/startup-flow)
* [DT network and mapping](/dt/network-and-mapping)
* [DT project layout](/dt/project-layout)
