Ninjutsu Games
Asset StoreYoutubeTwitterInstagramSupport
  • 🖐️Welcome!
  • Game Creator 2
    • ☢️Fusion Module
      • Setup
      • Sessions
      • Characters
      • Variables
      • Remote Procedure Calls
      • Settings
      • User Interface
      • References
        • Shutdown Reasons
      • Guides
        • How to test my game
        • How to toggle Debug mode
        • How to Update Fusion SDK
      • Releases
      • 🤝Fusion Factions
        • Releases
      • 💫Fusion Stats
        • Releases
      • 📦Fusion Inventory
        • Releases
      • 🧙Fusion Abilities
        • Releases
      • ⚔️Fusion Melee
        • Releases
      • 🔫Fusion Shooter
        • Releases
    • 🤝Factions
      • Setup
      • Faction Asset
        • Settings Editor
      • Member
        • Memory
      • Visual Scripting
        • Conditions
        • Events
        • Instructions
        • Properties
      • User Interface
      • Releases
      • 🌐Photon Factions
    • 🎮Coop
    • 👑Loot Locker
      • Getting Started
      • Authentication
        • Guest
        • White Label
        • Google
        • Steam
        • Apple Sign In
      • Sessions
      • Save Load
      • Players
        • Player Storage
        • Names
      • Leaderboards
        • Visual Scripting
      • Messages
      • Progressions
      • Replenish System
      • Date Time
        • Server Time
      • Handling Errors
      • Releases
    • 🤖State Machine 2
      • Graph Editor
      • State Machine Runner
      • Nodes
        • Node Features
      • Variables
      • Shortcuts
      • Releases
    • 🌐Photon Module 2
      • Overview
      • Releases
      • 🔫Photon Shooter
        • Getting Started
        • Releases
      • 💫Photon Stats
        • Releases
      • 📦Photon Inventory
        • Overview
        • Releases
      • 🧙Photon Abilities
        • Releases
      • ⚔️Photon Melee 2
        • Troubleshooting
        • Releases
  • Game Creator 1
    • Photon Network
      • Overview
      • Characters
      • Network Items
      • Actions
      • Conditions
      • Triggers
      • Guides
        • How to Connect and Instantiate your Player
        • Instantiation Options
        • How to Sync Attachments
        • How to display room or other network information
        • How to setup Camera Motor
        • How to test my game
      • Sub-Modules
        • 🏃Photon Traversal
        • ⚔️Photon Melee
        • 🔫Photon Shooter
          • Changelog
      • Changelog
    • State Machine
      • Editor Graph
        • Nodes
        • Blackboard
        • Copy & Paste
        • Targets
      • Export State Machines
      • Changelog
    • RPG (Deprecated)
      • Actor
        • Actions
        • Conditions
        • Triggers
      • Attributes
        • Actions
        • Conditions
      • Classes
        • Actions
        • Conditions
      • Skills
        • Actions
        • Conditions
      • Formulas
      • Changelog
    • AI & Factions (Deprecated)
      • Changelog
Powered by GitBook
On this page
  • 1. Connect to Photon
  • 2. Create or Join a Room
  • 3. On Joined Room
  • 4. (Optional) Connection Status
  • 5. Voila. This is how it should look.

Was this helpful?

  1. Game Creator 1
  2. Photon Network
  3. Guides

How to Connect and Instantiate your Player

PreviousGuidesNextInstantiation Options

Last updated 4 years ago

Was this helpful?

Connect to photon is really simple, here is a quick guide of how to connect, create a room and finally instantiate a character:

1. Connect to Photon

First create a trigger with On Start igniter, after you create the trigger go ahead create actions. Add a Photon Connect action, you can leave parameters as they are.

2. Create or Join a Room

Create another trigger with On Connection Events set the event type to On Connected To Master.

When photon is connected this event is going to be called. Let's add Join Or Create Action this will join a room o create if it doesn't exists.

3. On Joined Room

We want to instantiate our player once we join room so let's add a On Photon Event trigger and set the event type to On Joined Room. Within the On Joined Room event now add Photon Instantiate action and select or assign your Character Prefab.

Player prefab can't be present on the scene they need to be Instantiated with the Photon Instantiate action

Pro Tip: You can enable your player Camera after player is instantiated.

4. (Optional) Connection Status

You might want to have some feedback.

Let's add a text component to get the Photon Status but first we need the event. We can store the status/state in a local or global variable to later use this.

Finally add the text action and to show what we saved in a local variable.

5. Voila. This is how it should look.

Don't know which method to use? You can see more in

Instantiation Options
You must be connected to the Photon Service before trying to call any action except Offline Mode.
You are only allowed to call any join or create room action when you are connected to the Master Server.
(On this example we use a Player prefab that was previously added to Prefabs list in Photon Preferences)