by Pivec Labs
Getting Started Setup walkthrough

Getting Started

This guide walks you from a fresh Unity project to a real 1-to-1 video call or host-broadcast running through your own TURN relay.

01

1. Install the asset#

Import the NetCrafter Live .unitypackage into your project via Assets → Import Package → Custom Package. After import the following structure will appear under Assets/PivecLabs/NetCrafterLive/:

text
Documentation/      — these docs
Editor/             — editor window (Relay Settings, Server Setup Wizard)
Scripts/            — NetCrafterLiveConnection, NetCrafterLiveBroadcast, and their shared runtime helpers
ServerTools/         — install-live-server.sh + the rendezvous service, for self-hosting your relay

Then install the one required dependency via Window → Package Manager → Add package by name: com.unity.webrtc (version 3.0.0-pre.8 or compatible). This isn't bundled in the .unitypackage — Unity packages can't declare a Package Manager dependency automatically the way a UPM package can.

02

2. Open the NetCrafter Live editor window#

text
Unity menu → Tools → Pivec Labs → NetCrafter Live

Two tabs: Relay Settings (your TURN/rendezvous connection details) and Server Setup Wizard (stands the server up for you). Start with the wizard if you don't have a server yet.

03

3. Get a server running#

You need somewhere to run coturn (the TURN/STUN relay) and a small rendezvous service (resolves join codes to a host's relayed address). Pivec Labs does not host either for you — this is self-hosted by design, same as every other self-hosted piece of this product.

Two ways to get there, both covered in full in the Server Deployment Guide:

  • Server Setup Wizard (recommended) — the second tab in the editor window. Generates the exact commands for each step; you run them in your own terminal and paste the output back. It never connects to your server directly and never stores or transmits your credentials.
  • By hand — SSH in yourself and follow the Server Deployment Guide's numbered sections directly, or run install-live-server.sh (shipped in ServerTools/) yourself without the wizard's guided flow.

Either way, once it's done you'll have a Relay Host, Relay Port, Rendezvous URL, TURN Username, and Shared Secret — the wizard writes these directly into your project's Relay Settings for you; if you set the server up by hand, paste them into the Relay Settings tab yourself.

04

4. Add a component to a GameObject#

Pick the mode you want:

  • NetCrafterLiveConnection — a 1-to-1 call between exactly two peers.
  • NetCrafterLiveBroadcast — one host streaming to any number of receive-only viewers over one shared join code.

Add whichever one your scene needs via Add Component in the Inspector, same as any other MonoBehaviour.

05

5. Assign Relay Settings#

Select the GameObject you just added the component to. In its Inspector, click Assign Project's Relay Settings — this points the component's connectionSettings field at the same Relay Settings asset the Server Setup Wizard just configured. You never need to drag the asset in by hand or duplicate these values anywhere else; there's exactly one Relay Settings asset per project, and every component reads the same one.

06

6. Call it from your own code#

Both components are called from your own script — there's no built-in UI, on purpose, since your game's UI is yours to build. A few lines is enough to prove it works:

1-to-1 (NetCrafterLiveConnection)

csharp
public NetCrafterLiveConnection connection;

void OnHostButtonClicked() => connection.Host();
void OnJoinButtonClicked(string code) => connection.Join(code);

void Start()
{
    connection.JoinCodeReady += code => Debug.Log("Share this code: " + code);
    connection.ConnectionStateChanged += state => Debug.Log("State: " + state);
    connection.RemoteVideoTextureAvailable += tex => myRawImage.texture = tex;
}

Host-broadcast (NetCrafterLiveBroadcast)

csharp
public NetCrafterLiveBroadcast broadcast;

void OnStartBroadcastClicked() => broadcast.StartBroadcast();
void OnJoinBroadcastClicked(string code) => broadcast.JoinBroadcast(code);

void Start()
{
    broadcast.BroadcastCodeReady += code => Debug.Log("Share this code: " + code);
    broadcast.ViewerJoined += viewerId => Debug.Log(viewerId + " joined");
    broadcast.RemoteVideoTextureAvailable += tex => myRawImage.texture = tex; // viewer side
}

Run two builds (or one Editor + one build) — Host on one, Join with the code on the other — and confirm video/audio actually flows both ways before building real UI on top.

07

What's next#

  • Video Call Tutorial / Host-Broadcast Tutorial — run the shipped demo scenes and see a full, real integration of each component before building your own.
  • Add to Your Own Project — skip the demo scenes and wire both components directly into an existing game or app instead.
  • API Reference — full method/event/property list for both components.
  • Player Hosting Guide — how the join-code/relay flow works under the hood, and building a real lobby/join UI on the events above instead of Debug.Log.
  • Manual — every field in the editor window explained.
  • Third-Party Notices — attribution and license text for com.unity.webrtc and coturn, the two dependencies this asset relies on but doesn't bundle.