How to: Unity Online Multiplayer

How to: Unity Online Multiplayer

Tarodev

2 года назад

218,645 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Puneeth Sri Sai Satya Teja
Puneeth Sri Sai Satya Teja - 19.10.2023 19:43

this is a global multiplayer game or local IP multiplayer game?

Ответить
NRajpurohit
NRajpurohit - 28.09.2023 22:53

I want to know about host migration on game play (because now when host left all client left as well) so any one there to help me....

Ответить
Mason Crowe
Mason Crowe - 27.09.2023 21:57

absolute legend

Ответить
Tonbeans
Tonbeans - 14.07.2023 12:36

Help, Im getting

"Unity.Netcode; The type or namespace name 'NetworkBehaviour' could not be found (are you missing a using directive or an assembly reference?)"

Ответить
ADev2
ADev2 - 02.07.2023 13:51

You make me feel like a genius 😂

Ответить
Siva Subramaniam
Siva Subramaniam - 26.06.2023 10:15

i want to despawn objects from the client side how do I do that

Ответить
Ahmed Saad Tanim
Ahmed Saad Tanim - 05.06.2023 17:05

This is only Lan play right?

Ответить
stanley afon
stanley afon - 03.06.2023 10:02

This guy be wizard. Just TOO GOOD. Slightly better than Brackeys !!!

Ответить
Van Reilly
Van Reilly - 28.05.2023 03:00

Someone please help me! Every time I try to add the packages, errors come up on unity and I don't know what to do! 😭

Ответить
Ash Dev
Ash Dev - 20.05.2023 08:38

i can notice a delay between host and client. can it be real time with unitys multiplayer services like pubg and other fast paced games where there is no delay? if yes how? most of the tutorials i saw have a delay. i tested photon fusion battel royal demo and it has no lag. i dont know about multiplayer stuff. please help.

Ответить
CC_Gumball
CC_Gumball - 08.05.2023 15:52

sells me this:
NetworkBehaviour index 2 was out of bounds for CapsulePlayer(Clone). NetworkBehaviours must be the same, and in the same order, between server and client.

Ответить
JR
JR - 29.04.2023 12:31

do you need something like hamachi to host with another pc?

Ответить
Tubs
Tubs - 25.04.2023 13:13

Thank you

Ответить
VC
VC - 18.04.2023 21:19

I typed "using Unity.Netcode; ", and I still got an error saying "The type of namespace name 'NetworkBehavior' could not be found

Edit: NetworkBehaviour include the u

Ответить
kgZtcbvM TM
kgZtcbvM TM - 24.03.2023 18:02

Very good video! Ths really helped me understand more about Unity Netcode. :)
I saw "Alteruna Multiplayer" in the asset store that looks similar. They even have something very similar to "Player Prefab". One major change seams to be that they host free servers for you. I was trying to do a top-down game but was having issues with player interactions with objects.

Ответить
Adam Abbott
Adam Abbott - 15.03.2023 11:14

if the follow code was added into the system" public override void OnNetworkSpawn()
{
if (!IsOwner)
{
Destroy(this);
}
}", i got the error"[Netcode] NetworkBehaviour index 1 was out of bounds for Player(Clone). NetworkBehaviours must be the same, and in the same order, between server and client.". and if this code was not used, the player will not work at same time.

Ответить
Lora
Lora - 12.03.2023 20:45

Hi! This is just local connection or more?

Ответить
Tarek Demiati
Tarek Demiati - 25.02.2023 13:36

Question : Does unity provides managed server so small studios get a seamless integration and don’t need to setup third party severs.

Ответить
L&L&N
L&L&N - 21.02.2023 00:51

Minute 15 and I dont understand anything anymore. Fortuanetly I dont need it right now, I just was curiouse what might come in the future. Its always funny to see someone having full control of something you dont understand at all, and its nice if you suddenly do! ;D

Ответить
gamecreatorc
gamecreatorc - 19.02.2023 20:03

This is maybe the best tutorial for Unity's multiplayer. And I've watched a lot.

Ответить
Irina Hagman
Irina Hagman - 19.02.2023 12:05

Hi! Amazing video but PlayerNetWork skript is missing on Git

Ответить
Patricio Castillo
Patricio Castillo - 17.02.2023 00:52

It's work on android ?

Ответить
LeStrike
LeStrike - 13.02.2023 18:06

I might be blind but how exactly does your intantiation of the ball work? (There's no GameObject or anything like that attached, you call Instantiate and reference a script, I've never seen that before and I can't get it to work either)

Ответить
ZOM
ZOM - 10.02.2023 14:18

What am I missing? or is this video super out of date now or something?

NetworkManager doesn't appear with the clone - so you can't connect as client there... Manually re-adding a network manager to the clone predictably doesn't resolve it. Figured it's atypical to go off the rails straight away with your content - so I must be overlooking something.

And how do we handle the logic required to load a player? I assume you just call Instantiate somewhere? but where?

Ответить
Alex La
Alex La - 29.01.2023 19:53

Hello, thanks for this tutorial. I try respawn player to random position for example after die. I stuck with it. With ClientNetworkTransform or _playerState it work not always, I think its beacuse Update and change _playerState method work in different order. Any ides how release it?

Ответить
Michael Ong
Michael Ong - 26.01.2023 20:29

I spent 3 days just to find out that the script from multiplayer samples coop called "Client Network Transform" was the reason my clients couldn't properly adjust themselves when my project is running. I got confused with "Network Transform" thinking they're the same

Ответить
Mr Nobody
Mr Nobody - 26.01.2023 16:58

Hey @Tarodev I created a project using your method and it works like a charm but only on localhost, I tried changing the Unity Transport address to my static ip and still the client cannot connect to me if we have a different wifi, is it something to do with port forwarding? I would highly appreciate if you reply thank you for this awesome tutorial.

Ответить
erjuanjojj
erjuanjojj - 23.01.2023 20:50

One question, if one single client (client 24) needs to ask the server for some data thar server has, how can he do it? I come up with the client 24 calling the server using a funcion ServerRpc which has as input the client id (24), then the server call all the clients with this id (24) and the variable the client 24 needs, and finally the function ClientRpc has as input the id (24) and the variable needed. But it only uses the function if the id is the local client reading it, that way being ignored for the rest of the clients. Do you know a better way?

Ответить
durrium
durrium - 14.01.2023 13:57

Watched this again and learned a lot! I have one question though. When you are instantiating objects you are not using the NetworkObject.Spawn() function. Why is that? :)

Ответить
erjuanjojj
erjuanjojj - 13.01.2023 06:45

Awesome tutorial, but when I compile for Android my game does not connect with the PC, how can I connect between different devices?

Ответить
Eyal Srugo
Eyal Srugo - 06.01.2023 12:02

Can anyone explain how at the last example with the color change - Why only the player moving through the trigger changes color if they are both registered to the same OnValueChanged event? Beside that amazing work and thank you very much for these tutorials!

Ответить
Milockery
Milockery - 03.01.2023 06:52

Does this only work for people playing together on the same network?

Ответить
7ames
7ames - 30.12.2022 16:26

If anyone gets an error of: [Netcode] Behaviour index was out of bounds. Did you mess up the order of your NetworkBehaviours?
some awesome people on reddit found the reason and solution. It's caused by the public override void OnNetworkSpawn() if(!isOwner) Destroy line.
We've found that if you downgrade back to Netcode for gameobjects version 1.0.0 it fixes the issue. (version 1.2.0 threw the error for me.) Hopefully this helps someone down the line.

Ответить
Flurin Jenal
Flurin Jenal - 29.12.2022 12:06

This video is a true eye-opener on how powerful and intuitivie Netcode is! Question: How performant are RPC functions? I see that you are executing them in the Update function, is this something that can be easily done? Or should we be only using them seldomly? Also, a second question about performance, why not just increasing the "tick rate" on the Network Manager from 30 to let's say 60 or 100, and you won't even need to smooth movement as everything seems to sync quite instantly? Or may this cause performance problems later?

Ответить
tabooization123
tabooization123 - 28.12.2022 14:05

I've been working with other multiplayer solution and they pretty much have the same thing, did struggle with what the RPCs do on server and client side. Appreciate the explanations

Ответить
Flurin Jenal
Flurin Jenal - 28.12.2022 13:30

Very great video! Do you know if Netcode is performant enough for competitive games like RTS, FPS, MOBAs or anything esports like? I'm a bit hesitant because it says that it's made for "small co-op games" and their example of the Battle Royale game is actually not built with Netcode.

Ответить
mike miller
mike miller - 16.12.2022 22:32

I am having trouble with network variables. the host and client have 2 different values for the network variable.

Ответить
Moto Moto
Moto Moto - 14.12.2022 03:35

Thanks now I can make my club penguins game online

Ответить
Rojeh Habib
Rojeh Habib - 12.12.2022 10:38

A more suitable title for this video would be "Unity: My Online Multiplayer setup". other than the basics on the first half of the video you stopped teaching afterwards and mumbled gibberish.

Ответить
John Hershberg
John Hershberg - 10.12.2022 20:17

I would love it if you can do a more in-depth one about Client-side prediction. You touched on it a little bit. But I'm interested in full-on prediction, including reconciliation if the data from the server disagrees. Is this even possible with Unity's current implementation?

Ответить
Noah Borden
Noah Borden - 08.12.2022 22:45

Thank you so much for the helpful tutorial!
Do you only call client rpcs through server rpcs or are there cases where you call them from other places?
I’m sure it’s really obvious, but I couldn’t find anywhere on how to use them as opposed to what they do

Ответить
J K
J K - 06.12.2022 17:52

I just discovered your channel - awesome videos! Insta-Sub... :)

Ответить
Felipe Méndez
Felipe Méndez - 05.12.2022 05:41

this is amazing. BTW, do you know any better option than ParrelSync for testing? because cloning the project, specially if i need to test with 4-5 instances is just impossible... Any other tool? like to just simulate the game view? similar to what unreal does?

Ответить