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.
1. Install the asset#
Live voice and video is part of NetCrafter Relay 2.0 — import NetCrafter Relay and Live is already in your project, under Assets/PivecLabs/NetCrafterRelay/Live/:
Documentation/ — these docs
Editor/ — Inspector for the Live components (Definition picker)
Scripts/ — NetCrafterLiveConnection, NetCrafterLiveBroadcast, NetCrafterLiveRelayLink,
and their shared runtime helpers
(Relay's ServerTools/ — install-relay-server.sh + the rendezvous service, shared with the game relay)
Live needs one extra package, com.unity.webrtc 3.0.0 or later. Install it with one click from Tools → Pivec Labs → NetCrafter Relay → Settings → Live (Voice & Video), or via Window → Package Manager → Add package by name. Until it's installed, the Live code and demos simply aren't compiled, so Relay-only projects are unaffected.
2. Open the NetCrafter Relay editor window#
Unity menu → Tools → Pivec Labs → NetCrafter Relay → Settings
Live uses Relay's own settings, so there's nothing Live-specific to configure here. Three tabs matter: Relay Settings (your TURN/rendezvous connection details, per Definition), Server Setup Wizard (stands the server up for you) and Live (Voice & Video) (WebRTC install, demo scenes). Start with the wizard if you don't have a server yet.
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 Server Setup Wizard tab under Settings. 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-relay-server.sh(shipped inServerTools/) 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.
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.
5. Assign Relay Settings#
Select the GameObject you just added the component to. In its Inspector, pick a Definition under Use Definition and click Assign Relay Settings (normally the same Definition your game uses). This points the component's connectionSettings field at that Definition's Relay Settings — the same asset the Server Setup Wizard writes to and your game's connection manager reads, so one server serves both game and voice/video.
Already using NetCrafter Relay for the game? Also add NetCrafterLiveRelayLink: it starts the call or broadcast under the game's join code when you host, and joins it automatically when a player joins, so players never handle a second code. See the TurnBased Video Chat and Character Broadcast tutorials.
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)
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)
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.
7. Building for Mac, iOS and Android#
Live runs on Windows, macOS (Intel and Apple Silicon), Linux, iOS and Android. A few Player Settings matter:
| Platform | Player Settings | Notes |
|---|---|---|
| macOS / iOS | Camera Usage Description and Microphone Usage Description (Other Settings) — any short text, e.g. “Used for video calls”. | Required. With the camera text empty Unity refuses to build (“WebCamTexture class is used but Camera Usage Description is empty”); with the microphone text empty the app gets no microphone. The OS asks the player for access on first use. |
| Android | Scripting Backend IL2CPP, Target Architectures ARM64, Internet Access: Require, Landscape orientation for the demos. | Camera/microphone permissions are added by Unity and requested at runtime by Live. If remote video stays black on a device, tick Strip Video RTX Workaround on both sides. |
Mac builds made on Windows: copy the .app to the Mac, then once in Terminal run chmod +x YourApp.app/Contents/MacOS/* and xattr -cr YourApp.app (Windows zips drop the executable flag; unsigned apps are quarantined), and right-click → Open the first time.
Phones on mobile data almost never connect directly — set up the TURN server before testing away from your Wi-Fi.
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.webrtcand coturn, the two dependencies this asset relies on but doesn't bundle.