LogoLogo
HomeOnline DashboardAPIDiscordForums
SDK 1.6
SDK 1.6
  • Welcome
  • Overview
    • Features
    • Roadmap
  • Getting started
    • Get the Unity SDK
    • Setup a project
      • 1. Scene setup
      • 2. Prefab setup
      • 3. Test your game locally
        • Local testing using builds
        • Local testing via Unity's Multiplayer Play Mode
        • Local testing via ParrelSync
      • 4. Test in the cloud
        • Deploy a Replication Server
        • Share builds
    • How to... ?
    • Single-player to multiplayer
    • Video tutorials
    • Samples and tutorials
      • Package samples
      • Sample Connection UIs
      • First Steps tutorial
        • 1. Basic syncing
          • 1.1 Animation parameters
          • 1.2 Sending commands
        • 2. Physics / Authority transfer
        • 3. Areas of interest
        • 4. Parenting entities
        • 5. Complex hierarchies
        • 6. Persistence
      • Campfire project
        • Game mechanics
        • Leveraging object pooling
        • Remote interactions: Chairs
        • Remote interactions: Trees
        • A unique object with complex state
        • Custom instantiation and destruction
        • Running a server-side NPC
        • Playing audio and particles
        • A simple text chat
      • Beginner's guide to networking
    • Troubleshooting
  • Manual
    • Unity Components
      • CoherenceSync
      • CoherenceBridge
      • CoherenceLiveQuery
      • CoherenceTagQuery
      • CoherenceGlobalQuery
      • CoherenceInput
      • CoherenceNode
      • PrefabSyncGroup
      • Order of execution
    • Networking state changes
      • Instantiate and Destroy Objects
      • Supported types
      • Messaging with Commands
      • Syncing child GameObjects
      • Animation
      • CoherenceSync references
      • [Sync] and [Command] Attributes
      • [OnValueSynced] Attribute
      • Creating your own syncable member
      • Custom Component Actions
      • Rigid Bodies
      • Interpolation
    • Authority
      • Authority transfer
      • Server-authoritative setup
    • Lifetime
      • Persistence
      • Uniqueness
      • Example: A global counter
    • Parenting network entities
      • Direct children CoherenceSyncs
      • Deeply-nested CoherenceSyncs
      • Nesting Prefabs at Edit time
    • Asset management
      • Instantiating from CoherenceSyncConfig
      • Instantiate via
      • Load via
    • Scene management
    • Multiple Connections within a Game Instance
    • Baking (code generation)
      • Conditional compilation
    • Replication Server
      • Rooms and Worlds
      • Replication Server API
    • Simulators (Servers)
      • Scripting: Client vs Simulator
      • Run local Simulators
      • World Simulators
      • Room Simulators
      • Simulator slugs
      • Build and Deploy
      • Command-line arguments
    • Client Connections
    • Optimization
      • Areas of Interest
      • Level of Detail (LOD)
      • Profiling
      • Simulation Frequency
    • Project Settings
    • Advanced topics
      • Big worlds
        • World Origin Shifting
        • Load balancing
      • Competitive games
        • Simulation Frame
        • Determinism, Prediction and Rollback
      • Team workflows
        • Version Control integration
        • Continuous Integration
      • Schema explained
        • Specification
        • Field settings
        • Archetypes
      • Code stripping
      • Replication Server CLI
      • Single-player gameplay
    • Scripting API
  • Hosting
    • Choosing where to host
    • coherence Cloud
      • Online Dashboard
      • Manage Worlds
      • Configure Rooms
      • Player Accounts
      • Game Services
        • Lobbies
        • Cloud Storage
        • Key-Value Store (Legacy)
      • APIs
        • Worlds
        • Rooms
        • Lobbies
        • Cloud Storage
        • Key-Value Store (Legacy)
    • Peer-to-peer
      • Implementing Client hosting
  • Support
    • Release notes
    • Glossary
    • Unreal Engine support
    • WebGL support
    • ECS / DOTS support
    • Known issues
    • Upgrade guide
      • Upgrade 1.5 -> 1.6
      • Upgrade 1.4 -> 1.5
      • Upgrade 1.3 -> 1.4
      • Upgrade 1.2 -> 1.3
      • Upgrade 1.1 -> 1.2
      • Upgrade 1.0 -> 1.1
      • Upgrade 0.10 -> 1.0
      • Upgrade 0.9 -> 0.10
    • Credit cost & pricing
    • Report a bug
Powered by GitBook
On this page
  • Adding a dialog to the scene
  • Rooms connect dialog
  • Creating a room
  • World connect dialog
  • Modifying a sample
  • Upgrading samples

Was this helpful?

Export as PDF
  1. Getting started
  2. Samples and tutorials

Sample Connection UIs

Was this helpful?

The coherence package comes with several UI samples. The samples can get you connected to the Replication Server in no time, and are really useful for prototyping and learning.

In time, you can also edit the provided Prefabs and scripts however you want, to to fit the style and functionality of your game.

The currently available samples are:

  • Lobbies Connection dialog

  • Matchmaking dialog

The difference between Rooms and Worlds is explained on this page: , while have somewhat of a different role, in that they are usually used in addition to Rooms in a game flow.

Adding a dialog to the scene

Each sample comes with a Prefab that can be added to your Scene. You can add them via coherence > Explore Samples.

Effectively these do two things for you:

  1. Import the sample in the Samples directory of your project, if it isn't already.

  2. Add the Prefab from the sample to your Scene. Int the example above, that would be Room Connection Dialog.prefab.

My sample UI doesn't work!

If you notice that the samples are non-responsive to input, make sure you have a GameObject with an EventSystem component in the scene.

Rooms connect dialog

The Rooms Connect Dialog has a few helpful components that are explained below.

  • At the top of the dialog we have an input field for the player's name.

  • Next is a toggle between Cloud and Local. You can switch to Local if you want to connect to a Rooms Replication Server that is running on your computer.

  • Next is a dropdown for region selection. This dropdown is populated when regions are fetched from the coherence cloud. The default selection is the first available region. This is not enabled when you switch from Cloud to Local. This is also only relevant if you deploy your game to several different regions.

  • Next is a dropdown of available Rooms in the selected region (or in your local server if using the Local mode).

  • After selecting a Room from the list the Join button can be used to join that Room.

  • If you know someone has created a room but you don't see it, you can manually refresh the rooms list using the Refresh button.

Creating a room

The Create a room section adds a Room to the selected region.

This section contains controls for setting a Room's name and maximum player capacity. Pressing the Create button will create a Room with the specified parameters and immediately add it to the Room Dropdown above. Create and Join will create the Room, and also join it immediately.

World connect dialog

The Worlds Connect Dialog is a good option to start simple. It simply holds a dropdown for region selection, an input field for the players name, and a Connect button.

Modifying a sample

Upgrading samples

Future versions of coherence won't override your changes. If you upgrade to a newer version of coherence and import a new sample, they will be imported in a separate folder named after the coherence version.

If you want the new sample to overwrite the old one, first rename the folder in which the samples are, then import the new version.

You don't need to do anything else for the sample UIs to work (except of course, a needs to be running to connect to it!).

Also ensure that the mouse is not locked by a script. Is the cursor invisible? You might have a script that's modifying the . In that case, modify the script or remove it.

If you start a local World Replication Server, it will appear as LocalWorld. Similarly if there are Worlds running in the , they will be listed here.

Samples are copied to your assets folder, in Samples/coherence/version_number/. This means you can change and customise the scripts and Prefabs however you like.

The folder to rename is the one that is named after the version number (normally its path would be something like Samples/coherence/1.1.0/ for coherence 1.1.0).

📂
📁
Replication Server
cursor's lock state
coherence Cloud
Rooms and Worlds
Lobbies
customise them
Rooms Connection dialog
World Connection dialog
Adding the Room Connect Dialog creates a copy in your project
The Rooms connection dialog
Create room section of the Rooms Connect dialog
The Worlds connect dialog