• Register a callback that fires when a remote syncDestroy event is received. The callback receives the guid and the resolved Object3D (or null if not found in the scene). The callback fires before the object is destroyed, so you can still access its state.

    Parameters

    • callback: SyncDestroyCallback

      Called with the guid and the Object3D about to be destroyed

    Returns () => void

    An unsubscribe function

    const unsub = onSyncDestroy((guid, obj) => {
    console.log("Remote object destroyed:", guid, obj?.name);
    });
    // later: unsub();