Tutorial: Online multiplayer 🔫 FPS Unity & Photon Fusion EP5 (Host migration)

preview_player
Показать описание


In this episode we'll go through how to implement host migration in Photon Fusion. If the host is lost during a multiplayer game then a new host must be assigned and in this tutorial we'll go through the steps required to perform host migration in Photon Fusion.

💥 Join Our Community! 💥

Licensed under Creative Commons: By Attribution 4.0 License

Chapters:
00:00 What we'll cover in this tutorial
01:37 Activate Host Migration
02:24 Host migration events
17:52 Connection token
40:36 Fix camera issues
49:20 Host migration cleanup
52:27 Copy HP states
58:18 Camera reset
1:04:06 💗Patreon supporters

#PrettyFlyGames #LearnUnity #UnityTutorials #gamedev
Рекомендации по теме
Комментарии
Автор

One critical change is required for host migration to work when using multiple scenes.

Add the following to your NetworkRunnerHandler.cs file



//-->>>> Add this. New host needs to ensure that it knows what scene is active.


completed");

PrettyFlyGames
Автор

Amazing video man! Thanks for taking the effort to figure this out, must have been a struggle to get it working. I personally had a hard time with host migration a couple months ago, because of the little amount of official documentation. Gave up on it and have been postponing it for a while now. Seems like you figured out some things which I had not tried yet. Looking forward to try again with my own project now!!

ThemAirClowns
Автор

Excelent video! The explanation is so clear and how you progress along the video is on a great pacing. I'm waiting for new videos on this serie. Thank you so much!!

peche_gameDev
Автор

Very amazing video! I learned a lot! I'm having one problem though and I'm not sure if anyone else has encountered this. It works flawlessly whenever I run the host migration on the same network (on the same machine or different machines on the same network) but when we do this over other different networks the other player won't spawn even though they can see the remaining player moving around.

Example: There are 3 players connected on different networks. The host leaves and makes another player the host. One player character spawns and both remaining machines can see the character moving around. Expected behavior 2 player characters spawning.

linusaugustsson
Автор

this is such a great video! Thank you!

Joe-oqzn
Автор

Can we not just despawn all snapshot network objects in the host migration cleanup? Why do we need to check if player input authority isNone when we have a list of all the "dead" networkobjects (which should include the old network players)?

TenaciousDanR
Автор

Would it be possible to make a room list for joining games or a cod pre game lobby system

bagi
Автор

Fred, at 8:47, when we are instantiating a new NetworkRunner, - how is it determined which of the clients will manage to become a host?
I understand, this code gets ran on all devices, simultaneously. Does Fusion take care of deciding?
Thank you

igoraherne
Автор

Nice!

.please make next video to join the other authomatic room and make maximal room also make custom room

thank you

muhammadachir
Автор

⁠ I’m working on multiplayer project where in lobby I have menu with buttons and scene where users would be clients, with Oculus avatars. Do I need 2 network runners? Also when create new session is pressed, the session name and player number is not popping up? What can be wrong? Thank you so much

andrewo
Автор

this video helps me a lots, can u make another tutorial about dedicated server

AnhTran-zonf
Автор

Is it possible to migrate host while current host is still active like we can do for Masterclient in PUN 2?

rishitvaidya
Автор

Can we use hostMigration if GameMode is shared and not Host?For switching scenes.

andrewo
Автор

In fusion, if the player is disconnected from the room, how a player can join that room again after some time. Plz make a video of it plz plz

manoimran
Автор

Is there a way to load old in-game messages when a host migration has been cleaned up? i tried to store a List of in-game messages in my static instance of GameManager but it's not working :<

LeHieu-srkn
Автор

Many thanks for your helpful Videos.👍
How can we find out if our friend is online or not in photon fusion?

meysamh
Автор

ConnectionTokenUtils gives error. I'm missing that script (27:08). Can You help please? Thanks

andrewo
Автор

i have no work to say just thank you !! help me dont waste my time

vinhlam
Автор

Why would you need host migration if photon advertises that everything runs on their servers ?

elrymoe
Автор

Help me explan why Photon dont do migration like PUN 2,

vinhlam