Templates vs Flows
PairKit gives you two ways to define what shows up on the player’s phone. Pick the simpler one until you outgrow it.
Templates — one screen for the whole session
A Template is a single, fixed widget layout. Every player connected to the session sees the same widgets, for the entire session. Examples:
- D-pad + buttons for a platformer demo.
- A full-screen tap area for a reaction-time game.
- A text input + submit button for a kiosk.
Templates are the right choice when:
- The phone-side experience never changes.
- Every player has the same role.
- You want the simplest possible setup — drag a template asset onto
PhoneControllerManagerand you’re done.
PairKit ships four built-in templates: D-pad + Buttons, Tap / Buzz, Text Input, and Joystick. Create one via Assets → Create → PairKit → Templates → ….
Flows — multi-screen, per-player
A Flow is a named collection of screens. Each screen has its own widget layout. The host transitions players between screens at runtime:
- Show all players a
lobbyscreen until everyone is ready. - Move them to a
roundscreen with d-pad controls when the game starts. - Show one specific player a
pick_wordscreen while everyone else stays onwait_for_drawer.
Flows are the right choice when:
- The phone-side UI changes mid-session (lobbies, voting rounds, mini-game phases).
- Different players see different screens at the same time.
- You want to use one of the higher-level patterns:
PromptAsync,RequestAsync, orRequestResendAsync.
Author a Flow via Assets → Create → PairKit → Flow Asset. The inline editor lets you define screens and their widget lists. Drag the Flow asset into the manager’s Flow Asset slot — it takes precedence over Template if both are set.
Decision shortcut
| Question | Answer |
|---|---|
| Do all players always see the same controls? | Template |
| Do you need to transition the UI mid-game? | Flow |
Will you use PromptAsync or RequestAsync? | Flow (PromptAsync requires a Flow; RequestAsync works with either) |
| Are different players in different roles? | Flow |
| Are you writing a small demo or test scene? | Start with a Template, switch to Flow if it grows |
You can migrate from a Template to a Flow later — the wire protocol underneath is the same widget data model. Templates are essentially Flows with one screen. Pick the smaller surface until the smaller surface stops working.