📝 The Ultimate 2D & 3D Shader Graph Course: tinyurl.com/3b5zac7c 🌎 Let us know what you think about this video, also feel free to chat with us on our Discord server :discord.com/invite/b6bXKSV ❤ Support us on Patreon www.patreon.com/BinaryLunar and gain access to all our tutorials projects. 📦 Check our Assets on Unity Assets Store: assetstore.unity.com/publishers/47136
Just wanted to say thanks for the awesome tutorial! I loved how you showed us the mistake first and then gave us the fix - it made everything so clear and easy to understand.
Tbh, this is the best video I have seen. The video is not perfect, but you didn't step away from sharing the mistakes and fixes. Which is awesome. I was able to understand lot of things. Thank you very much for the content mate. Showing mistakes and fixes is the best way to make someone understand things better. Hats off for the effort you took for putting this together
@@BinaryLunarThat will be awesome. This video its self is great. If you are making a series it will be nice. Also one request try to make the videos a bit smaller. I prefer watching 10-20 mins (each part) videos for learnings.
For those stuck at the syncing animations part where you make OwnerNetworkAnimator script Timestamp: 20:02 Add to the top: using Unity.Netcode; using Unity.Netcode.Components;
Hey man. Awesome vid. I like that you covered that spawning part. Was so frustrated to find all prefabs just spawning at the origin even though i coded something else. Other tutorials didn't cover this
Thank you so much bro... I was stuck with the object despawning since a whole day and after this video my game os working fine.. Thanks a lot.. You saved my day
I would love to see a multiplayer game that is turned based. Most Unity Content providers are showing samples of the same type of game where they control a player with movement and firing, etc. What about an example of a game where it is turned based and there are components that are not really assigned to a player but to a game manager. For example, if you have a spinner in the beginning of the game where it decides which player goes first. How does this work, do you spawn a network prefab or run an RPC to tell each system to run the same code. And, if so how do you sink the random generator variable because only the host client should actually determine the value. It then gets complicated on synched buttons that are shared. And, if you have a common UI (One that doesn't float over and belongs to a player) how do you sync things like text displays, turns left, money, health bars, etc. There are few examples of this type of multiplayer Netcode games. (Thanks!!!)
You talked through this very well! I listened to this in my car after pulling my hair out for hours and the rpc stuff was what I needed to pay more attention to. Also, release that video on network object pooling yet? Really a lack of resources I feel like, the documentation is meh
What an explain for the unity NetCode feature. I am too grateful for you about this video, if you can make another one where you talk about fixing bugs in a DGS NetCode game in unity.
Though I bought the udemy shader course to give something back for this youtube tut but having looked at it quickly looks like I'm the lucky one getting added value for my money.. Would recommend the udemy course to others who happens to drift by 🤠
@@BinaryLunar The ultimate regarding software positioning for the future, could be some ARFoundation based stuff where we in a multiplayer world got aligned real and virtual space maybe through some spatial Anchor (Google?, MS Azure? immersal?, snapdrag spaces? or the pokypoky guys) starting on a phone now and then easily ported to snappydrag AR 2 processor devices... late next year+
Sorry, at 18:22 its not seeing it work here, the client transform component cant be added, the git link works but it shows its installed alreayd, what am i missing here?
it wouldnt install for me, so i found another link on the same page which took me to the github, where i simply downloaded the Client Network Transform script
@@im_an_intern_unity_dev soon after i posted this comment i realised that my game would be too hard to code with netcode since i was making an FPS game, so i ended up restarting and using photon instead
the github version is nothing more than this code: by creating a new script and then assign this to the player prefab/object. [DisallowMultipleComponent] public class ClientNetworkTransform : NetworkTransform { /// /// Used to determine who can write to this transform. Owner client only. /// This imposes state to the server. This is putting trust on your clients. Make sure no security-sensitive features use this transform. /// protected override bool OnIsServerAuthoritative() { return false; } }
Would have finished my project weeks ago if I had found this tutorial from day one. The other tutorials didn't cover the random positions spawning which is what I've been trying to troubleshoot for so long
00:00 Вступление 01:13 Настройка и объяснение демонстрационной сцены 02:00 Сценарий перемещения игрока 02:57 Сценарий стрельбы снарядом и его перемещения 03:36 Установка сетевого кода для GameObjects и настройка сетевого менеджера 04:20 Преобразование проигрывателя в сетевой объект 05:40 Создание пользовательского интерфейса сетевого менеджера 09:05 Установка консоли отладки в игре, которая поможет отладить автономную сборку 10:06 Использование сетевой переменной для отображения количества подключенных игроков 16:08 Использование сетевого преобразования для синхронизации перемещения между хостом и клиентами 18:55 Использование сетевого аниматора для синхронизации анимации 20:40 Рандомизация положения появления игрока и фиксация поворота при появлении 23:35 Объяснение проблем, связанных с появлением и исчезновением игровых объектов в многопользовательской игре 27:14 Разница между серверным Rpc и клиентским Rpc 28:07 Использование ServerRpc для развертывания и удаления снарядов по сети 37:06 Исправлена проблема со случайной позицией появления 38:25 Создаем hud игрока и используем сетевую переменную для отображения имен игроков 43:50 Назначение цветов подключенным игрокам 46:26 Тестирование игры с участием 4 связанных игроков 47:15 Завершение
Hello, excellent video. I would like to know, in your game, how would you change scenes in the middle of the game without losing connection? Where when passing through a portal, both players were teleported to another scenario.
This is a fantastic video! Thank you for putting it together! I am gettina a "Setting linear velocity of a kinematic body is not supported." error when firing the projectile" I think this fixes it: Change the line in MoveProjectile.cs from "rb.velocity = rb.transform.forward * shootForce;" to "rb.MovePosition(rb.position + (rb.transform.forward * shootForce) * Time.deltaTime);" and it should fix the issue.
Hello, great video. But I have questions about the camera. What if this is a fps game where every prefab character has a camera ? How do I remove/disable the other cameras besides the current player ?
here is what I did : I first disabled every cam, and then added this script in the player controller : void Start() {if(IsOwner){PlayerCam.enabled = true;}} with a reference to the player camera : public Camera PlayerCam;
Good tutorial so far, but what if I want to sync my player renderer mid-session? What if Instead of destroying the player, I want to disable the mesh renderer? I can't seem to figure out or understand through the documentation on how to sync it properly between both host and client.
Hi, How do I go about spawning each player in a specific area, I'm creating a racing game and I want them to spawn in position 1 2 3 and 4.Thank you for the great video so far!
It is only playable when the players are on local network? Actually I am looking to implement multiplayer system like Mini milatia where players on the same network can play, so will this tutorial help for that???
so for some reason the host client stops moving etc when 1 or more clients join. the other clients work perfectly. but the host client specifically stops moving when i control or try to rotate the camera for that client. any ideas.
One small query : After lobby, i have to move to the Level Selection scene which selects which level to choose. That level scene is an addressable which is being downloaded from cloud. But net code does not seem to work with addressable scene. Any advice? I am thinking two options : 1) Use RPC to manually load the addressable scene on all clients 2) Make all the contents of the scene an addressable prefab and then include the empty scene in build settings which can be loaded through netcode. Then instantiate the adressable when the scene is loaded by netcode. Thanks in advance 😃
Nice video! But I have an issue, I’m making a game that the player can use items. The items are prefabs and contain NetworkObjects, but I can’t spawn the prefabs in the player hand transform because of the player also has a NetworkObject. Any solution to this?
As documentation says - Spawning can always be done on the host/server. If you want to give a client control over spawning objects, you need to implement a server RPC that you call on the client to spawn the object. So, use RPCs
I have problems with multiplayer. The problem is when I want to install the client network transform plugin or multiplayer samples utilities, I can't import or install these plugins. Can anyone help?
I BELIEVE it is no longer available as the URL has been removed from GitHub. This seems to be recent as I was able to get to them a few weeks back but no longer. I think you will have to write your own class to override the authoritative transform. using Unity.Netcode.Components; public class MyClientNetworkTransform : NetworkTransform { protected override bool OnIsServerAuthoritative() { return false; } }
As a "player" I'm using the standard 3rd person armature that comes with the Starter Assets. My problem is that when I press "play" and then "Start Host" on the NetworkManager, my "player" will fall through the ground. I can fix it by setting the ground to something negative like -2 but in the example here, that is not done, everything appears to be left to zero/default. What am I doing differently if anyone can tell from my problem description?
Because there is no gravity in this example, the one you are using sets the player into the floor a bit such that the collision event is triggered and the isGrounded variable is set
Hi, In the scenario, where you are giving your name at fist and try to start server, then for host its good, but for clients, I am not able get the name. as client is not allowed o write in the network variable. please suggest me for such reason..
[Netcode] [DestinationState To Transition Info] Layer (0) does not exist! Why this error shown for my animation. When i transition one animation to another also i have animationStatebehaviour with my animation. I am using unity 2020.336f1
Hello I am getting error"NetworkBehaviour index 1 was out of bounds for MyMotorBike(Clone). NetworkBehaviours must be the same, and in the same order, between server and client. "
Hey, i had a question. How can we make shared objects with it, for example in a game like fall guys, the players can push each other. How can we do that in this????
As a "player" I'm using the standard 3rd person armature that comes with the Starter Assets...my understanding is that this uses exactly what you ask about. My problem is that when I press "play" and then "Start Host" on the NetworkManager, my "player" will fall through the ground. I can fix it by setting the ground to something negative like -2 but in the example here, that is not done, everything appears to be left to zero/default. I'm not sure what my problem is but I'm trying to figure it out. Everything seems to work fine as long as I set the ground to -2 or something like that.
Excellent Tutorial. Thansk a lot! Now i understand Netcode a little bit better. But i have one problem with my game now. If i start this game with 2 players (1 host, 1 client) for the host game everysthing works perfect. But in the client game when i move the player it moves with a big delay. first the text above the player moves and after that the player moves. but this with a big delay. Does anyone know a solution? Or is it just a bad connection?!
I have lobby where the players can connect to the host. That is a differt scene, then the game scene. My problem is, that when the player connects, the player prefab will be spawn, in the lobby. Can you tell me how can I manage that the player prefab is spawned when the game starts?
Hi - just in case you don't get an official response right away and are anxious to resolve you are correct the player will be spawned where you network manager is. You just need to have your character controller or any attached script override the default instantiate position to where you would like your spawn point to be. So somewhere on you character you need to have a method like: (Pseudo code) Public class RepositionMyPlayer : NetworkBehaviour { public override void OnNetworkSpawn() { transform.position = myStartingPosition; } } Just remember you need your class to inherit from NetworkBehaviour
@@BinaryLunar you are lucky, i also downloaded separately ,install all .net components , still I have facing issues with unity projects in visual studio .
@@BinaryLunar just now rechecked ,game development with unity workload is checked and installed. Fixed by repair and regenerate project files in unity.
Like this tutorial, but having one problem. in the ShootFireball script, I cant call the DestroyServerRpc function on the host nor client. everything is spelt and capitalised correctly, ive tried putting it in the Movefireball script because the clients fireballs cant find the parent script for some reason. any ideas?
Excellent video! I have two questions: 1) The project files from your Patreon page seems to be for the complete version. How can I get the "before" version (with the animations and such, but not the networking code added during the video) so I can work through the tutorial? 2) The completed code works great on one machine: I can run a local build and also run it within the Unity editor, and they talk to each other happily. When I run a build on a second machine, I get an error "Cannot start Client while an instance is already running". It's very strange that this only happens across two machines! What's going on, and how can this be fixed?
1. Send us a message on patreon to try to provide a copy of the project without networking. 2. This tutorial is just for showing the networking logic, you need further steps to make it work online , by adding relay. We have full course on Udemy to show the whole process and build full online game. www.udemy.com/course/create-online-multiplayer-game-in-unitynetcoderelaylobby/
That's probably because client authoritative movement is easy to grasp and get started with. He explained the basics of using RPCs and NetworkVariables, so with that and the official documentation that was mentioned/provided in the description, you should have enough info to get started in experimenting with different authoritative models yourself. Good luck with your endeavours!
Dose someone of you get this error after dow Mu-Samples U ?? Library\PackageCache\com.unity.multiplayer.samples.coop@a4cafe2062\Utilities\SceneManagement\SceneLoaderWrapper.cs(85,32): error CS1061: 'NetworkManager' does not contain a definition for 'OnClientStopped'
📝 The Ultimate 2D & 3D Shader Graph Course: tinyurl.com/3b5zac7c
🌎 Let us know what you think about this video, also feel free to chat with us on our Discord server :discord.com/invite/b6bXKSV
❤ Support us on Patreon www.patreon.com/BinaryLunar and gain access to all our tutorials projects.
📦 Check our Assets on Unity Assets Store: assetstore.unity.com/publishers/47136
Just wanted to say thanks for the awesome tutorial! I loved how you showed us the mistake first and then gave us the fix - it made everything so clear and easy to understand.
You are welcome , glad to hear that.
Tbh, this is the best video I have seen. The video is not perfect, but you didn't step away from sharing the mistakes and fixes. Which is awesome. I was able to understand lot of things. Thank you very much for the content mate. Showing mistakes and fixes is the best way to make someone understand things better. Hats off for the effort you took for putting this together
You are most welcome, soon will release full course about creating full multiplayer game.
@@BinaryLunarThat will be awesome. This video its self is great. If you are making a series it will be nice. Also one request try to make the videos a bit smaller. I prefer watching 10-20 mins (each part) videos for learnings.
Sharing how you fix mistakes is probably the best part about learning it.
For those stuck at the syncing animations part where you make OwnerNetworkAnimator script
Timestamp: 20:02
Add to the top:
using Unity.Netcode; using Unity.Netcode.Components;
Thanks!
Hey man. Awesome vid. I like that you covered that spawning part. Was so frustrated to find all prefabs just spawning at the origin even though i coded something else. Other tutorials didn't cover this
Thank you so much bro...
I was stuck with the object despawning since a whole day and after this video my game os working fine..
Thanks a lot.. You saved my day
You are welcome!
The video is great and understandable for everyone.
I would love to see a multiplayer game that is turned based. Most Unity Content providers are showing samples of the same type of game where they control a player with movement and firing, etc. What about an example of a game where it is turned based and there are components that are not really assigned to a player but to a game manager. For example, if you have a spinner in the beginning of the game where it decides which player goes first. How does this work, do you spawn a network prefab or run an RPC to tell each system to run the same code. And, if so how do you sink the random generator variable because only the host client should actually determine the value. It then gets complicated on synched buttons that are shared. And, if you have a common UI (One that doesn't float over and belongs to a player) how do you sync things like text displays, turns left, money, health bars, etc. There are few examples of this type of multiplayer Netcode games. (Thanks!!!)
We will consider your request in the next multiplayer game poll.
+1 to this request
As soon as host leave the meeting client also disappear
Did you figure this out? I’m wanting the same for my game
+1 to this request.
You talked through this very well! I listened to this in my car after pulling my hair out for hours and the rpc stuff was what I needed to pay more attention to. Also, release that video on network object pooling yet? Really a lack of resources I feel like, the documentation is meh
What an explain for the unity NetCode feature. I am too grateful for you about this video, if you can make another one where you talk about fixing bugs in a DGS NetCode game in unity.
Thank you for this video. It has been very helpful.
Glad to hear that!
Excellent video, very much appreciate you clearly putting a lot of effort into this :)
You are welcome🙏
Though I bought the udemy shader course to give something back for this youtube tut but having looked at it quickly looks like I'm the lucky one getting added value for my money.. Would recommend the udemy course to others who happens to drift by 🤠
Kind of you, we planning for full multiplayer course with mini playable game.
@@BinaryLunar The ultimate regarding software positioning for the future, could be some ARFoundation based stuff where we in a multiplayer world got aligned real and virtual space maybe through some spatial Anchor (Google?, MS Azure? immersal?, snapdrag spaces? or the pokypoky guys) starting on a phone now and then easily ported to snappydrag AR 2 processor devices... late next year+
Btw Since I prefer watching Udemy to Netflix and HBO Max I'm looking forward to enjoying your upcoming multiplayer course... )O(
very cool guide, you helped me so much, and yes, can you make a guide where you will make a pvp game? it would be so cool
Sorry, at 18:22 its not seeing it work here, the client transform component cant be added, the git link works but it shows its installed alreayd, what am i missing here?
it wouldnt install for me, so i found another link on the same page which took me to the github, where i simply downloaded the Client Network Transform script
@@InfernalHedgehog thank you, I will have a look a your solution, indeed im sure it will work, I took other path for online multiplayer game
@@InfernalHedgehog Can you help me with the ClientNetworkTransform please, I tried everything but still cant make the client move
@@im_an_intern_unity_dev soon after i posted this comment i realised that my game would be too hard to code with netcode since i was making an FPS game, so i ended up restarting and using photon instead
the github version is nothing more than this code:
by creating a new script and then assign this to the player prefab/object.
[DisallowMultipleComponent]
public class ClientNetworkTransform : NetworkTransform
{
///
/// Used to determine who can write to this transform. Owner client only.
/// This imposes state to the server. This is putting trust on your clients. Make sure no security-sensitive features use this transform.
///
protected override bool OnIsServerAuthoritative()
{
return false;
}
}
Would have finished my project weeks ago if I had found this tutorial from day one. The other tutorials didn't cover the random positions spawning which is what I've been trying to troubleshoot for so long
00:00 Вступление
01:13 Настройка и объяснение демонстрационной сцены
02:00 Сценарий перемещения игрока
02:57 Сценарий стрельбы снарядом и его перемещения
03:36 Установка сетевого кода для GameObjects и настройка сетевого менеджера
04:20 Преобразование проигрывателя в сетевой объект
05:40 Создание пользовательского интерфейса сетевого менеджера
09:05 Установка консоли отладки в игре, которая поможет отладить автономную сборку
10:06 Использование сетевой переменной для отображения количества подключенных игроков
16:08 Использование сетевого преобразования для синхронизации перемещения между хостом и клиентами
18:55 Использование сетевого аниматора для синхронизации анимации
20:40 Рандомизация положения появления игрока и фиксация поворота при появлении
23:35 Объяснение проблем, связанных с появлением и исчезновением игровых объектов в многопользовательской игре
27:14 Разница между серверным Rpc и клиентским Rpc
28:07 Использование ServerRpc для развертывания и удаления снарядов по сети
37:06 Исправлена проблема со случайной позицией появления
38:25 Создаем hud игрока и используем сетевую переменную для отображения имен игроков
43:50 Назначение цветов подключенным игрокам
46:26 Тестирование игры с участием 4 связанных игроков
47:15 Завершение
Increible tutorial, Awesone!!
Hello, excellent video. I would like to know, in your game, how would you change scenes in the middle of the game without losing connection? Where when passing through a portal, both players were teleported to another scenario.
This is a fantastic video! Thank you for putting it together! I am gettina a "Setting linear velocity of a kinematic body is not supported." error when firing the projectile"
I think this fixes it:
Change the line in MoveProjectile.cs from "rb.velocity = rb.transform.forward * shootForce;" to "rb.MovePosition(rb.position + (rb.transform.forward * shootForce) * Time.deltaTime);" and it should fix the issue.
Hello, great video. But I have questions about the camera. What if this is a fps game where every prefab character has a camera ? How do I remove/disable the other cameras besides the current player ?
here is what I did : I first disabled every cam, and then added this script in the player controller :
void Start()
{if(IsOwner){PlayerCam.enabled = true;}}
with a reference to the player camera :
public Camera PlayerCam;
Hi bro! Excelent job, can you show how to create a system hit or attack in to a players? Thanks!!
Good tutorial so far, but what if I want to sync my player renderer mid-session? What if Instead of destroying the player, I want to disable the mesh renderer?
I can't seem to figure out or understand through the documentation on how to sync it properly between both host and client.
Hi, How do I go about spawning each player in a specific area, I'm creating a racing game and I want them to spawn in position 1 2 3 and 4.Thank you for the great video so far!
Would love to see an example using OpenXR.
Sure, we will open a voting for the next multiplayer tutorial.
Awesome vid!
thanks alot for this, is there any way to do sphere and cube as two players ? instead of two capsule with different colors
Of course everything is possible
Loving the lesson just wanted to know how can I assign a camera to each player?
Pls , a coop game , with hosting also
It is only playable when the players are on local network? Actually I am looking to implement multiplayer system like Mini milatia where players on the same network can play, so will this tutorial help for that???
so for some reason the host client stops moving etc when 1 or more clients join. the other clients work perfectly. but the host client specifically stops moving when i control or try to rotate the camera for that client. any ideas.
Seems this issue is from using unitys new input system. if i use the old input system it works perfectly...
I did everything as you yet when I start the client, the player does not spawn as when I start the host.
One small query :
After lobby, i have to move to the Level Selection scene which selects which level to choose.
That level scene is an addressable which is being downloaded from cloud.
But net code does not seem to work with addressable scene.
Any advice?
I am thinking two options :
1)
Use RPC to manually load the addressable scene on all clients
2)
Make all the contents of the scene an addressable prefab and then include the empty scene in build settings which can be loaded through netcode. Then instantiate the adressable when the scene is loaded by netcode.
Thanks in advance 😃
36:22 Where did you call your ServerRpc funktion "DestroyParticlesServerRpc()"?
You are right, I forgot to call it in a Start function.
I can't seem to get the player nametags to show properly. Can you help me with that, thanks in advance!
Nice one!
Appreciated
Спасибо! Отличное видео!
I cant spawn my projectiles when on client side, it works on host side perfectly, can you help me plss?
Nice video! But I have an issue, I’m making a game that the player can use items. The items are prefabs and contain NetworkObjects, but I can’t spawn the prefabs in the player hand transform because of the player also has a NetworkObject. Any solution to this?
As documentation says - Spawning can always be done on the host/server. If you want to give a client control over spawning objects, you need to implement a server RPC that you call on the client to spawn the object.
So, use RPCs
In the Unity Boss Room demo they used a position constraint component on the item instead of parenting it to a holder object
I have problems with multiplayer.
The problem is when I want to install the client network transform plugin or multiplayer samples utilities, I can't import or install these plugins. Can anyone help?
Up
I BELIEVE it is no longer available as the URL has been removed from GitHub. This seems to be recent as I was able to get to them a few weeks back but no longer. I think you will have to write your own class to override the authoritative transform.
using Unity.Netcode.Components;
public class MyClientNetworkTransform : NetworkTransform
{
protected override bool OnIsServerAuthoritative()
{
return false;
}
}
As a "player" I'm using the standard 3rd person armature that comes with the Starter Assets. My problem is that when I press "play" and then "Start Host" on the NetworkManager, my "player" will fall through the ground. I can fix it by setting the ground to something negative like -2 but in the example here, that is not done, everything appears to be left to zero/default. What am I doing differently if anyone can tell from my problem description?
Because there is no gravity in this example, the one you are using sets the player into the floor a bit such that the collision event is triggered and the isGrounded variable is set
I'm using this tutorial to make a first person game, but when i have 2 people in a server, they look out of the wrong cameras. How would I fix this?
you need to add in the player script if (!IsOwner) Destroy({canera_refference})
Hi, In the scenario, where you are giving your name at fist and try to start server, then for host its good, but for clients, I am not able get the name. as client is not allowed o write in the network variable. please suggest me for such reason..
@BinarLunar if we implement all this code with mixed reality tool kit addons then we can run a multiplayer mixed reality application?
[Netcode] [DestinationState To Transition Info] Layer (0) does not exist!
Why this error shown for my animation. When i transition one animation to another also i have animationStatebehaviour with my animation. I am using unity 2020.336f1
thanks 😀
You are welcome!
What to do when there are two cameras in the scene?
Bro how to make it live over internet ??
Hello I am getting error"NetworkBehaviour index 1 was out of bounds for MyMotorBike(Clone). NetworkBehaviours must be the same, and in the same order, between server and client.
"
i also have it, how can i resolve?
Hey, i had a question.
How can we make shared objects with it, for example in a game like fall guys, the players can push each other.
How can we do that in this????
im getting error on spawning "only server can spawn network objects". can someone help?
thank you papa, how hard would it be implementing input system and cinemachine?
As a "player" I'm using the standard 3rd person armature that comes with the Starter Assets...my understanding is that this uses exactly what you ask about. My problem is that when I press "play" and then "Start Host" on the NetworkManager, my "player" will fall through the ground. I can fix it by setting the ground to something negative like -2 but in the example here, that is not done, everything appears to be left to zero/default. I'm not sure what my problem is but I'm trying to figure it out. Everything seems to work fine as long as I set the ground to -2 or something like that.
Excellent Tutorial. Thansk a lot! Now i understand Netcode a little bit better.
But i have one problem with my game now. If i start this game with 2 players (1 host, 1 client) for the host game everysthing works perfect. But in the client game when i move the player it moves with a big delay. first the text above the player moves and after that the player moves. but this with a big delay. Does anyone know a solution? Or is it just a bad connection?!
I have lobby where the players can connect to the host. That is a differt scene, then the game scene. My problem is, that when the player connects, the player prefab will be spawn, in the lobby.
Can you tell me how can I manage that the player prefab is spawned when the game starts?
Hi - just in case you don't get an official response right away and are anxious to resolve you are correct the player will be spawned where you network manager is. You just need to have your character controller or any attached script override the default instantiate position to where you would like your spawn point to be. So somewhere on you character you need to have a method like:
(Pseudo code)
Public class RepositionMyPlayer : NetworkBehaviour
{
public override void OnNetworkSpawn()
{
transform.position = myStartingPosition;
}
}
Just remember you need your class to inherit from NetworkBehaviour
@@NerradKramp thank you very much!
i need help i use a root server if i try to connect the playerprefab dont spawn. on local host it works very well.
plz share your visual studio unity extensions list , all I can find are visual code ones.
I downloaded visual studio 2022 separately.
@@BinaryLunar you are lucky, i also downloaded separately ,install all .net components , still I have facing issues with unity projects in visual studio .
@@Kiran.KillStreak it is not luck, while installing it you should select Unity support.
@@BinaryLunar just now rechecked ,game development with unity workload is checked and installed. Fixed by repair and regenerate project files in unity.
how does that work with rigid movement?
I just added it, but my rb movement doesn't work
Like this tutorial, but having one problem.
in the ShootFireball script, I cant call the DestroyServerRpc function on the host nor client. everything is spelt and capitalised correctly, ive tried putting it in the Movefireball script because the clients fireballs cant find the parent script for some reason. any ideas?
Fixed this issue, i was doing "if (!isOwner)" instead of "if(!isOwner) return;"
@@polarsvisuals4132 good job
Excellent video! I have two questions:
1) The project files from your Patreon page seems to be for the complete version. How can I get the "before" version (with the animations and such, but not the networking code added during the video) so I can work through the tutorial?
2) The completed code works great on one machine: I can run a local build and also run it within the Unity editor, and they talk to each other happily. When I run a build on a second machine, I get an error "Cannot start Client while an instance is already running". It's very strange that this only happens across two machines! What's going on, and how can this be fixed?
1. Send us a message on patreon to try to provide a copy of the project without networking.
2. This tutorial is just for showing the networking logic, you need further steps to make it work online , by adding relay. We have full course on Udemy to show the whole process and build full online game.
www.udemy.com/course/create-online-multiplayer-game-in-unitynetcoderelaylobby/
@@BinaryLunar Ah, I didn't realize there was an additional component needed. I may just go with local multiplayer + Parsec instead. Thanks!
Netcode for Gameobjects have any limitations of ccu?
is there a way i can have a reference to a list of players? I've tried network Lists but they always seem to break
An how do i make individual camaras for each player?
How can i change player name from playe1,player2,player3 --> mr.a mr.b mr.c
For some reason I could not make the game and the code is not correct at all?
@binary lunar i can give scripts?
waiting for netcode pooling system
thanks
You are most welcome!
it will work if the game is for android
???
@@Proxypp is that a question or statement?
this vs Mirror?
Thanks!!!
tnx
my client is not moving :(
Follow the tutorial carefully, probably you not using client transform or forgot to set the movement based on ownership.
Leave it to unity to make git hub necessary for their shit to work.
Sadly another tutorial without server model...
That's probably because client authoritative movement is easy to grasp and get started with. He explained the basics of using RPCs and NetworkVariables, so with that and the official documentation that was mentioned/provided in the description, you should have enough info to get started in experimenting with different authoritative models yourself. Good luck with your endeavours!
Nice 666 likes
Fish net better
Dose someone of you get this error after dow Mu-Samples U ??
Library\PackageCache\com.unity.multiplayer.samples.coop@a4cafe2062\Utilities\SceneManagement\SceneLoaderWrapper.cs(85,32): error CS1061: 'NetworkManager' does not contain a definition for 'OnClientStopped'