Needle Engine Documentation
Getting Started
Tutorials
How-To Guides
Explanation
Reference
Help
Getting Started
Tutorials
How-To Guides
Explanation
Reference
Help

Networking & Multiplayer

Build multiplayer 3D web experiences with shared state, voice chat, and real-time synchronization.

Needle Engine includes a full networking solution for multiplayer experiences. Shared world state, voice chat, session persistence, and more can be achieved with our networking components and APIs.

Quick Start

Get your first multiplayer scene running in 5 minutes:

  1. Add a SyncedRoom component to your scene
  2. Add SyncedTransform to an object
  3. Add DragControls to make it interactive
  4. Open in two browser windows and drag the object!

Follow the complete setup guide →

What Can You Build?

  • Collaborative Spaces - Multiple users exploring and interacting together
  • Multiplayer Games - Real-time games with synchronized state
  • Virtual Meetings - Persistent meeting spaces with voice chat
  • Interactive Experiences - Shared AR/VR experiences across devices
  • Collaborative Design - Real-time 3D design collaboration

Choose Your Path

🎯 First Time with Networking?

Start with the basics:

  • Enable Networking - Add multiplayer to your project (5 min)
  • Sync Component State - Use @syncField for automatic networking
  • Understanding Networking - Learn how it works

🔧 Building Something Specific?

Jump to practical guides:

  • Sync Component State - Automatic networking with @syncField
  • Manual Networking - Send and receive custom messages
  • Host Your Own Server - Deploy custom networking infrastructure

📚 Want to Understand How It Works?

Learn the concepts:

  • Networking Architecture - Rooms, ownership, and state
  • Message Types - JSON vs Binary (Flatbuffers)
  • WebRTC for Voice - How voice chat works

📖 Looking for Reference?

Find specific information:

  • Networking Events - Complete event reference
  • Built-in Components - Networking component catalog
  • API Documentation - TypeScript API docs

Built-in Networking Components

ComponentDescription
SyncedRoomHandles networking connection and room management
SyncedTransformSynchronizes object transforms (position, rotation, scale)
SyncedCameraSpawns a prefab for each user showing their viewpoint
VoIPVoice-over-IP audio connections between users
ScreenCaptureScreen sharing via web APIs - Example
NetworkingCustomize server backend URL or use local server
DragControlsDrag objects with automatic ownership transfer
DuplicatableDuplicate objects across the network
DeletableDelete objects across the network
DeleteBoxDelete objects when dragged into a volume
PlayerSyncInstantiate an object for each connected player
PlayerStateComponent for objects instantiated by PlayerSync
PlayerColorAssign each user a random color
WebXRSynchronize VR/AR avatars (hands and heads)

Default Networking Infrastructure

By default, Needle scenes connect to cloud infrastructure managed by Needle:

  • ✅ No additional setup needed
  • ✅ Currently no additional cost
  • ✅ Works fine for 15-20 concurrent users per room
  • ✅ Perfect for prototyping and small deployments

For production or larger deployments, you can host your own server.

Common Questions

How many users can connect?

Default servers: Around 15-20 concurrent users per room works well.

Custom servers: Scalable to hundreds or thousands of users depending on your infrastructure.

Is voice chat included?

Yes! Use the VoIP component for voice chat and the ScreenCapture component for screen sharing. Both use WebRTC (peer.js) for direct peer-to-peer connections.

Can I use my own server?

Absolutely! The networking server is available as an NPM package and can be deployed anywhere. See Custom Servers for details.

How is state persisted?

Room state is automatically saved on the server as JSON. When new users join, they receive the current state. You can configure storage to use disk (default) or S3-compatible services.

Can I send custom messages?

Yes! Use manual networking for complete control over messages. You can send JSON or binary (Flatbuffer) messages with custom data.

How-To Guides

Setup & Basics:

  • Enable Networking - Add multiplayer to your project
  • Sync Component State - Use @syncField decorator

Advanced:

  • Manual Networking - Send custom messages
  • Host Your Own Server - Deploy custom infrastructure

Learn More

Understanding:

  • Networking Architecture - How networking works
  • Built-in Components - Component catalog

Reference:

  • Networking Events - Complete event reference
  • API Documentation - TypeScript API

Resources:

  • Networking Package - NPM package
  • Local Server Setup - Development server

Next Steps

  1. Enable Networking - Get started with your first multiplayer scene
  2. Sync Component State - Learn automatic networking
  3. Understanding Networking - Learn the concepts
Suggest changes
Last Updated: 1/28/26, 10:47 AM

On this page

Extras

Copy for AI (LLMs)