Fusion

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Fusion: Load Scene For Master Client (Shared Mode)

Webkostya
2022-05-30 17:46:38

Create Room (Shared Mode). OnConnectedToServer -> OnPlayerJoined (spawn player) -> Load New Scene = Spawn Player Not Moved To New Scene 😥

Joined Room (Shared Mode). OnConnectedToServer -> Load New Scene -> OnPlayerJoined (spawn player) -> GOOD ! 😀

How to do joining after load scene ?

HELP 😭

Comments

Isaac_Augusto
2022-06-01 13:21:10

Hi,

The player prefab is being destroyed because it spawned on the unloaded scene. There's some ways to avoid that problem, an obvious one is to make the player prefab DontDestroyOnLoad, but that's hardly something you want.

There's no need to spawn the player on the OnJoined callback, you can have a networked behaviour on the scene you want to load that act as a spawner, and on Spawned() method it spawns the player prefab.

In shared mode, is common to each player spawn it own character prefab. By the way, you don't need to pass an input authority (input authority does nothing on shared mode, as each client is the state authority over it own character, but of course you can pass the local player if you want to).

// On a spawner class that is present on the scene that you want to load.    

Spawned(){    
  Runner.spawn(playerPrefab, position, rotation, Runner.LocalPlayer)    
}    

Isaac Augusto

Photon Fusion Team

Webkostya
2022-06-02 06:53:50

It works ! Thank you ! 🤟

Example:

Back to top