Quick Start Guide

Preview

Fusion Godot SDK 3.0.0 is a development preview and is not intended for production use.

Introduction

This guide builds a basic multiplayer project with synchronized movement, custom properties and RPCs.
Complete source code is in the demo/basic/ directory of the SDK.

Step 1 — Photon Account

  1. Create an account at dashboard.photonengine.com.
  2. Click Create a New App, select Fusion as the SDK, and Version 3 (Unreal and Godot).
  3. Copy the App ID.

Step 2 — Install the SDK

  1. Download from SDK Download.
  2. Copy addons/fusion/ into your project root.
  3. Reopen the project — Godot loads the GDExtension automatically.

Step 3 — Project Settings

Set your credentials in Project Settings > Fusion > Photon Cloud:

  • app_id — your Photon App ID
  • app_version — version string (e.g. "1.0")
  • default_region — Photon region (e.g. "us", "eu")
Project Settings — Fusion
Project Settings — Fusion

GDScript

FusionClient.initialize_from_settings()

Step 4 — Main Scene

Main (Node2D)
+-- ConnectButton (Button)
+-- StatusLabel (Label)
+-- FusionSpawner (spawn_path: "../Players")
+-- Players (Node2D)

GDScript

extends Node2D

const PlayerScene = preload("res://player.tscn")

@onready var spawner: FusionSpawner = $FusionSpawner

func _ready():
    spawner.add_spawnable_scene(PlayerScene)
    FusionClient.room_joined.connect(_on_room_joined)
    spawner.spawned.connect(func(n): print("Spawned: ", n.name))

Step 5 — Connect and Join

GDScript

func _on_connect_pressed():
    var user_id = "user_%d" % randi()
    FusionClient.connect_to_server(user_id)
    FusionClient.connected_to_server.connect(func():
        FusionClient.join_or_create_room("test_room")
    )

Step 6 — Player Scene

Player Scene Setup
Player Scene Setup

Player (Node2D)
+-- Sprite2D
+-- Label
+-- FusionReplicator (replication_mode: AUTO)
Player FusionReplicator Settings
Player FusionReplicator Settings

REPLICATION_AUTO syncs position and rotation automatically with smoothing selected based on root node type.

Step 7 — Spawn on Join

GDScript

func _on_room_joined():
    var pos = Vector2(randf_range(100, 700), randf_range(100, 500))
    var player = spawner.spawn()
    player.position = pos

Step 8 — Movement

GDScript

extends Node2D

const SPEED := 200.0
@onready var sync: FusionReplicator = $FusionReplicator

func _process(delta):
    if sync.has_authority():
        var dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
        position += dir * SPEED * delta

func _ready():
    sync.authority_changed.connect(func(auth):
        $Sprite2D.modulate = Color.GREEN if auth else Color.RED
    )

Only the owning client processes input.
Remote positions are smoothed automatically.

Step 9 — Test

  1. Set Debug > Run Multiple Instances to 2.
  2. Press Play, click Connect in each window.

Both clients join the same room and see each other's players.

Step 10 — Custom Properties

Add any custom properties via the bottom panel for FusionReplicator, then these will also be replicated automatically.

Player FusionReplicator Settings
Player FusionReplicator Settings

GDScript

var player_name: String = "":
    set(value):
        player_name = value
        $Label.text = value

See Replication Config for property types and arrays.

Step 11 — RPCs

GDScript

@rpc("any_peer", "call_local")
func show_message(text: String):
    $MessageLabel.text = text

func send_message():
    FusionClient.rpc(show_message, "Hello!")

See RPCs for broadcast RPCs and target options.

Next Steps

Back to top