Synchronization in 3 minutes - FishNet multiplayer - Unity - Ep. 4 (Tutorial)

preview_player
Показать описание
This is episode 4 to the short series where i explain you how to setup a multiplayerproject in Unity. In this video we are taking a closer look at Synchronization via the network and how we push this to all the clients as well.

Scripts used in video:

FishNet syncronization documentation:

If you have any questions, leave them in the comments and i'll try my best to help you.

A like, comment and perhaps a subscription with the bell notifications turned on, is very much appreciated! But i love you anyway for just watching :)

0:00 Introduction
0:16 Setup
0:30 Base script setup
1:17 Syncronization
3:08 Testing from Server
3:50 Testing from Client
4:15 Outro
Рекомендации по теме
Комментарии
Автор

Join the awesome discord community here!

BobsiTutorial
Автор

Just ran into this series whilst looking for someone that goes over Fish Networking and found your hidden gem of a series. You should mention somewhere in your title that it uses fish networking, I nearly overlooked your videos thinking its the typical mirror tutorial. Keep up the awesome work! You're really detailed with this.

Crazyzooka
Автор

I would also highly recommend expanding on SyncVar and how to use them to call other functions with OnChange = nameof(). When I set up my UI for displaying player health this is how I get the clients to update their local UI to properly display their health.

FidesFrater
Автор

I saw some previous episodes, a lot of stuff is saved and done client side. If you want to not have your game hacked that easily you move as much as you can server side or at least get the server to double check things. (you did mention this in a reply, I think it's important to mention it in the video as well, the simple use cases you record is good though as long as people know they must build on top of it)
Thanks for the videos btw

jefawk
Автор

Great tutorial! Good detailing! Keep up the great work!

funmasterplays
Автор

clear and concise tutorials ty so much

davidpitcher
Автор

Thanks for the vid I’ve been trying to get my multiplayer working

Google_Offical
Автор

Lol Your First Recording Of This Must Have Been At Least Good To Us, Because This Is Really Good.

marshmellows
Автор

Great video! Very clear and easy to understand :-)

XesserX
Автор

Nice video, just one thing to keep in mind that, you don't need to write GetComponent if you are referencing the same object that you are already in.

ysftulek
Автор

Why do you need to Get component <playerHealth>?
Can’t you just “enabled = false”?

seppukun
Автор

i believe im correct but someone please correct me if im wrong

but doesn't this cause a vulnerability with the health, i know this is a simple tutorial but if someone wanted to use this im pretty sure the if the player had a hack for the game, could locally increase their health and it would sync across the server to the other players?

im not sure since im rather a newbie when it comes to unity, i usually use Roblox and they have their own networking. and ik that you have to code it on a "Script" rather than a "LocalScript" for the player not to be able to change it or mess with it

But still i am loving the series, as im trying to break away from roblox to make a game to publish on steam and this series is definitely great for learning just wanted to check to see if this is true in this case as well?

NV-SLM
Автор

Thank you for the video tutorial.
But I'm still confused about the chat system using Fishnet (broadcast). Will you make the video about it?

lgent
Автор

I changed the variable to: private readonly SyncVar<int> clientAmount = new SyncVar<int>(); as the documentation told me to do, but in the 104th string where I have the script.clientAmount += amountToChange; it tells me that: error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) and I"ve got no idea how to fix it, pls help

DogOnRock
Автор

I was trying to display player's health on top of the player with rpc but got error that textmeshpro is not supported in rpc. Is it even possible with fishnet

tushkeissi
Автор

can you use this to play with friends or only your house people

benofficialyt
Автор

First of all thanks for the tutorial series. It shows [SyncVar] to be deprecated for me, but somehow I don't find the new version. Is there no new version at all and every such variable is handled server side now?

Pleb-zith
Автор

I have a problem: when I start the game on my phone, the other device cannot connect. But everything works on the computer.

carturgames
Автор

Is the health here updating in the client, sending to server, and then to all clients? Or is it sending a request to server to update the health, and then update for all clients? Trying to understand how to setup server authority here. Thanks

jeffevans
Автор

Hello, great tutorial! But when I try to play with a friend (one of us host the server and both create clients - on different computers) we are in different servers and do not see each other. How can I fix this?

monstersocke