❤ Watch my FREE Complete Multiplayer Course th-cam.com/video/7glCsF9fv3s/w-d-xo.html 💬 This was a ton of work so I really hope you like this video! Go ahead and build some multiplayer games! Thanks! 🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses 👇 Click on Show More 🔴 RELATED VIDEOS 🔴 How to use Unity Relay, Multiplayer through FIREWALL! (Unity Gaming Services) th-cam.com/video/msPNJ2cxWfw/w-d-xo.html Join your Players in MULTIPLAYER with Lobby! (Unity Gaming Services) th-cam.com/video/-KDlEBfCBiU/w-d-xo.html EASY Console! Run any Command! (Add Cheats, Set Gravity, Spawn Enemies Quantum Console Asset Review) th-cam.com/video/bOf6CjpuSFs/w-d-xo.html Why you should NOT make everything PUBLIC! th-cam.com/video/pD27YuJG3L8/w-d-xo.html What are Delegates? (C# Basics, Lambda, Action, Func) th-cam.com/video/3ZfwqWl-YI0/w-d-xo.html How to use NEW Input System Package! (Unity Tutorial - Keyboard, Mouse, Touch, Gamepad) th-cam.com/video/Yjee_e4fICc/w-d-xo.html What are Generics? (C# Basics) th-cam.com/video/7VlykMssZzk/w-d-xo.html What are Value Types and Reference Types in C#? (Class vs Struct) th-cam.com/video/KGFAnwkO0Pk/w-d-xo.html What is the DIFFERENCE between Transform and GameObject? (Unity Tutorial for Beginners) th-cam.com/video/B-dVf9wUEbg/w-d-xo.html Kickstart your game with First and Third Person Controllers! (FREE Unity Starter Assets) th-cam.com/video/jXz5b_9z0Bc/w-d-xo.html Free Unity Multiplayer? Backend? Monetization? What is Unity Gaming Services? th-cam.com/video/JwClCc2_zC8/w-d-xo.html Unity Authentication in 100 SECONDS! (Log in, Anonymous, Unity Gaming Services, Cloud Save, Relay) th-cam.com/video/1KSKRaacdKE/w-d-xo.html Quantum Console assetstore.unity.com/packages/tools/utilities/quantum-console-211046?aid=1101l96nj&pubref=ngo FREE Third Person Controller assetstore.unity.com/packages/essentials/starter-assets-third-person-character-controller-196526?aid=1101l96nj&pubref=ngo
Great Tutorial! Covering everything in one video is perfect! Advenced users can easily skip to any part they need and beginners can easily look over at this video while building any game and skip to any part they need help with quickly. One of the most perfect unity tutorials out there. I have been using netcode for the past year, something like this is definitely what we need. Thank you!♥️♥️♥️
@@jorgeabuauad Yes the curly brackets allows you to construct something and instantly set any of it's public fields, so it acts similar to a constructor in that you create and assign values at the same time
If you're having trouble with the new setup of NetworkManager's Network Prefabs Lists like I did, you need to add a NetworkPrefabsList to your project. You can do what I did and right click your Assets folder in the Project tab and click Create -> Netcode (was at the top for me) -> Network Prefabs List. Then you can add whatever Network Object to it and continue the tutorial like normal. Hope that helps.
6:10 in newer version Unity doesn't accept individual prefabs but rather a scriptable object that contains prefabs. So right click-> create->net code->network prefab list
How has this guy NOT been sponsored more? The content is absolutely brilliant, look at the time release from Netcode for Game Objects and this insanely comprehensive and easy to understand guide. I'm definitely going to be looking at getting CM's course, even if I don't fully complete them or ever look at them I know I'll be supporting one of the greatest resources to young aspiring game developers. So many thanks on behalf of so many people CM!
Thank you! The timing of this 1.0 release could not have been better and your prompt, and stunningly complete, tutorial is already saving me a ton of headaches.
@@foncode101 underneath the video in the row of icons with Thumbs Up, Thumbs Down, etc. There is one called Thanks with a dollar sign in a heart. Depending on how much you're going to donate you could alternatively buy one of his courses, if you don't have them already.
Thank you so much for this! There's a severe lack of multi-player tutorials, specially of those that are free, and most importantly up to date. I was trying to send $10 with my comment but I forgot my password. I will donate when I get back home from work. Thanks again for all you do and continue the great work! We all appreciate you.
Thank you for the tutorial!😊 To those who unable to get the client to move when switching to the third/3rd person character controller. I think, the problem is duplicating Player Input component by spawning 2 prefabs with it. There are two variants that fixed this for me: 1. Switch Actions under the Player Input component attached to PlayerArmature to DefaultInputs. To do this, remove Actions object what is currently there. It will propose you to create new one to replace empty space, click this btn and create new Actions with default settings by this flow. 2. Move Player Input component and StarterAssetsinputs from PlayerArmature object to separate one. In this case you will have in scene only 1 Player Input component and they will not conflict with each other. Also do not forget to make code changes from CM.
I also struggled making the second client move. My solution was to disable the PlayerInput component in the prefab by default and simply enable it back again (in the PlayerControllerScript) only if the current player is the owner of the object. _playerInput = GetComponent(); if (IsOwner) _playerInput.enabled = true; I hope this may also help somebody.
I was looking into this also and if you join as client in the editor you can see that the controller type isn't KeyboardMouse. Seems like there are multiple solutions here but in many instances this wouldn't be an issue since a client connecting from a different device would not have input conflicts. I ended up just setting the controller type directly. I would plan on creating an option for the player to set their input options in a setting screen prior to connection also. For testing purposes: if (_playerInput.currentControlScheme != "KeyboardMouse") { _playerInput.SwitchCurrentControlScheme("KeyboardMouse", Keyboard.current, Mouse.current); }
@@CodeMonkeyUnity whoa! Near to a 100+ hours then I suppose. In the previous comment I didn't think about voice-overs but they do indeed take a bunch of time
Just getting back into network programming. Great tutorial. Also, they are moving pretty fast. The Network Variable synchronization now also supports strings.
From the bottom of my heart, thank you for this gigantic work: I don't even dare to imagine the time it took you for the search for information, the tests and the editing. I had some knowledge on Mirror, I didn't have too many difficulties to follow. Armed with this new knowledge, I will be able to progress in this area.
if your client doesn't move is because in the input system is setting for Xbox Controller, in the StarterAssetsInputs script, implement a start method with these lines: PlayerInput PlayerInput = GetComponent(); PlayerInput.SwitchCurrentControlScheme("KeyboardMouse", Keyboard.current, Mouse.current);
Dude, I've been trying to get this working for days now, and just stumbled upon your tutorial. First place where I've seen these topics actually make sense, and the steps are clear enough to follow. I hope the viewers support can help keep you going!
To those unable to get the client to move when switching to the third person character controller, switch Actions under the Player Input component attached to PlayerArmature to DefaultInputs. Alternatively you can make your own InputActions file, which I had to do because for some reason DefaultInputs inverted the Y axis of my mouse input.
Just what i needed. I have been watching your videos for the past two years and trying to make my hobby as an indie a real thing. Your videos have been a great help thank you very much!
Thanks a lot I have been trying to use Photon to make multiplayer games but now that this is released i was hyped and already seeing a video from you explaining all of it is just surreal. Keep going and don't feel down about yourself your doing amazing things most people can't.
For anyone watching this recently and trying to use the newinput system from starterassets and client is not moving, you have to disable playerinput by default and only enable it when player IsOwner, but its ideal to follow the tutorial with the given exact steps and version
This is such a great tutorial. Update for Unity 6.0 and 2024: The Network Transform component now has a dropdown for Authority Mode, and you no longer need ClientNetworkTransform.
I figured out what makes your videos so good for me. It is the pacing. I tend to skip forward in videos because there's a lot of "filler". Here, every second something is happening is actually informative, and coding is sped up. Nice :D
Thankyou! Not only do you tell us what to do, you explain it to us, which unlike most other tutorials, allows us to fully understand and do whatever we want with the knowledge instead of directly telling exactly what to do. Once again, thankyou, this is very useful for me as a beginner testing out unity multiplayer.
I'm watching over and over, again and again; I believe this video not only helps me but many others like me. I would upvote this video as many times as I watch it.
This is an incredible resource, and will definitely be helpful to many game devs. I would love to see you discuss: multiplayer teams that handle things like friendly fire and team spawn points, multiplayer character select screens, as well maps or something like lobby voting. There's so much untapped potential when it comes to Unity multiplayer tutorials.
This is absolutely what people need to get started with Multiplayer games in Unity. Looking forward to the Unity Gaming Services video and maybe a walkthrough of the Boss Room sample game!
For the Network Animator section 48:53, I had the same issue as other where the client wouldn't move, but the other solutions didn't work for me. To fix this I followed a stack solution. You just need to uncheck the Player Input component in the PlayerArmature, then paste the following code into the controller: public override void OnNetworkSpawn() { base.OnNetworkSpawn(); if (IsOwner) { _playerInput = GetComponent(); _playerInput.enabled = true; } }
Hello, I have tried implementing this solution. Now player control works in client side. However the animation is not synchronised. Can you help me if something you have done?
Before trying this my character could move as the host but as the client i couldn't move and the host wasn't updating. After trying this solution i can move from the client side but the movement and animation are not updating
Hyped for more videos on NGO! Specifically on the Relay topic, but also on topics regarding more advanced concepts like interpolation to hide latency, extrapolation or clientside prediction, etc.
I have tried to set up a Linux server using this tutorial. At first I failed and I had to search for a long time until I found the solution. In retrospect, this was very simple. Maybe one or the other will find this information helpful. In the NetworkManager under UnityTransport you also have to specify the IP Addresses under Server Listen Address. If in doubt just use 0.0.0.0 to use all IP addresses.
You are a gift to Unity creators everywhere! This video really helped me get over the hump with networking. I loved the bite size topics - I referred to it several times while coding my game. The biggest issue with networking for me was knowing where the data was, and getting and setting it properly - this video was instrumental in helping me make it happen. Thank you!
This by far is the best tutorial video EVER. The pace of the video is absolutely perfect! Thank you so much for this video it has helped me a ton with starting to grasp this concept / side of unity. I can't wait for the future episodes!!!
I mean Brackeys was perfect and all but content of Code Monkey is somewhere else. Responding to comments, creating tutorial shortly after release.. Currently the best game dev channel. Should acquire more attention.
Thanks a lot!! A one hour tutorial turned into about 8~10 hours work because I kept going off on tangents learning and experimenting but the best way to learn, cheers!
I've been trying and failing for months to figure out search algorithms and data structures for turn-based strategy game, so I jumped at your course the moment I saw it. Easiest $20 I ever spent.
@@CodeMonkeyUnity I really like the challenges where you have us pause and try and work out the solution ourselves. It's really rewarding to solve a problem on your own.
Boi, first of all thanks for the turnbase game course, bought it and it was top quality. Second of all, as someone from IT, I respect you for takeing the time to get familiar with networking just to help your viewers. Much respect and keep up the good and quality work 🥳🥳
At 26:30, you would want to limit reading in cases where one person has info that no one else should know from the server. Think of like Among Us, some player is the saboteur and the rest are running around as innocents doing tasks. No one else needs to know who the saboteur is on the client side. In our game we had to lock down a lot of stuff like that because of cheaters and hackers using that sort of info to their advantage.
Oh you're right. I was thinking "if only the owner can read why make it a NetworkVariable at all?" and yeah the answer is for any knowledge that you want both the Server and just that one specific Client to know about. For just the Server or just the Client you would only need a non-networked variable, but for some knowledge that only those 2 know then yup I guess that's the use case. Thanks!
For anyone that is facing an issue with the client not moving at all, just import any other character asset with animations and attach the PlayerNetwork script to that character. The third-person starter asset was not working for me so I tried doing this and this worked. Cheers
Are you using Root motion? If so then yes motion will be linked to animations, but if you have the animations set up like I have in the demo, with no root motion, then there's no link between animations and position
@@CodeMonkeyUnity The issue is animations are syncrhonized whenever I go back to client it works fine, when to turn back to host, it does not change to its cinemachine camera I can control character but with seeing client's view
@@perspectives2202 I imported another character asset with different animations and set up the running animations manually then I followed all steps of the video like adding network object etc and it worked
This video is insane! Amazing work! So much detailed! I learned a lot! I would be amazing if you would expand this tutorial to make a mini game! I have yo say that I expected this tutorial to be a payed tutorial, so I appreciate that you made this video for free! But I would also bought it or the expansion of this tutorial. Thank you so much for all your effort!
Can you PLEASE make a tutorial on picking up, holding, using, and dropping items in multiplayer? Parenting is seemingly impossible with Netcode and I feel like you could figure it out! A p2p tutorial would also be awesome! Thanks!
OMG this is so good! you make probably the most detailed videos in the Unity TH-cam. I would love a tutorial like this for a simple turn based game (cards, classic JRPG or something like that) with a dedicated server.
Any plans on making a full course on multiplayer? I'm currently enrolled in your turn based course and i'm really enjoying it, you're helping me build the game of my dreams! thanks a lot man!
I would love to but courses take a ton of time to make so not sure if I can, I'm researching if I can make something on a smaller scale that wouldn't take several months to build
seems like code monkey should be sponsored more! Like DUDE! THIS IS AWESOMEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!!! its really detailed and i can understand it even if i have no networking experience and easy to learn with Code Monkey's Teaching style which is just talking and talking about the important stuff and nothing else! Its also SUPER beginner friendly!
For everyone facing the issue with the client not moving after you added the third-person controller. The issue is the new Input System, it does map the same input system on the host and on the clients so to fix this issue write: _playerInput.enabled = true; after the if(!IsOwner) return; what this does it maps the Input system on the client which is the owner. Code example: private void Update() { if (!IsOwner) return; _playerInput.enabled = true; //this line of code is what you are missing to fix the issue .... }
Have anyone else had the issue where the ThirdPersonController does not work on the client? Up until 49:39 everything works, but then I cannot move with the client. I've added the " if(!isOwner) return; " in ThirdPersonController script , I've got ClientNetworkTransform syncing positions, and I've added the player prefab to the NetworkManager. pls help :3 Edit: The problem seems to be the PlayerInput which auto-selects a Control Scheme other than KeyboardMouse. Connecting a gamepad solved that temporarily.
Many thanks for the super thanks! I'm glad you found the video helpful! Check out the free course if you want to see this implemented in a full project th-cam.com/video/7glCsF9fv3s/w-d-xo.html
Hey, I'm having a problem when using multiple camera's. How would I go about fixing this? I cannot seem to get clients to ignore other camera's that are within the scene. Any help is appreciated
What problem? Are you using Cinemachine? If so you need to make sure the local player, with IsOwner true is the only one with a Virtual Camera. Either destroy the virtual camera on the other players or lower their priority.
@@CodeMonkeyUnity I am not using Cinemachine, however, I've tried lowering the priority and couldn't get that to work so I'll try destroying other players cameras.Thank you for your help.
You are the best, covering the theories from Networking and explaining how the code is working is what very less tutorials do. They don't usually explain "How it works?".
Great video, however I still encountered an issue, I am using standart Third Person controller and my client still not moving even after I put Client network transform on it (. EDIT: okay, small update here, I... think at least, I was able to streamline the problem and the it seams like client simply not able to edit any variable even though Client Network transform is on object AND Server authority turned off. EDIT2: please show how to encorporate this netcode with Starter Assets input (Third person), this thing is giving me so much headache it is just crazy.
I had the same problem. I noticed that the Control Scheme of the player input was set to Xbox Controller on the client but was set on keyboard/mouse on the server. So I forced the control scheme of player input using the method SwitchCurrentControlScheme of the PlayerInput and it's now working as expected. I have no idea why the second player added was set to Xbox Controller.. There might be a better solution.
@@Groumpif I know you wrote this months ago but thanks so much for this reply. Just saved me a lot of headache figuring out why my clients wouldn't move with mouse and keyboard.
Coming back to this video months later when starting another multiplayer project. it made me feel good you still active and helping people. Most helpful content creator I ever seen
You are literally the best. I wanted to make a multiplayer game really bad and considered photon but its kinda outdated. This couldnt have gone any better. Thank you for your contribution
Thanks for the super thanks! Yeah nowadays thanks to these awesome tools it is insanely easy to make multiplayer games compared to how it was previously. Best of luck with your games!
been watching this channel videos and always wonder how one person would developed this much GODSENT SKILL of simplifying and instructing complex things.
Thanks for the kind words! I'm always trying to improve the way I teach, I believe I've improved quite a lot since my first video 5 years ago, who knows where I'll be in 5 more!
Already made a game with NGO, but I must admit, this video would have helped me a lot. I'm really waiting for the next video about all topics around relay, lobby, matchmaker and game server hosting
Not everyone dedicates their time and effort researching and putting these together, not to mention the hassle of always building and running unity to test server and clients. That parallelsync extension really comes in handy.
Amazing video! Thanks a lot for your work 🙏🏼! Now I understand way better how to use NetCode for Game Objects and my goal to create a turn-based multiplayer game seems even more realizable to me.
From experience most tutorials make things look way easier than when you get into trying it yourself. You did a A1 job of making this look as easy as possible. :D
I'm not using a regular movement system in my game, so I got a bit ahead of you and got so worked up about how I was going to do the variables when they were set inside an if owner thing. Then I watched 10 more seconds
I can't really put it into words my friend. The amount of effort, the speed in which you did all this, the details and just everything. I don't feel appreciated as "audience" I feel as if my older brother had stayed up all night to help me study a difficult subject. I can't really see you as a content creator after witnessing this amount of effort and dedication to us. You are truly a great friend, and an amazing person.
This is so cool! I finally bought a synty asset for my next game coming, and it is going to feature local multiplayer. This video will be very helpful. I'll watch it very early tomorrow morning before getting ready for the day. Thank you Mr Code Monkey! You rock!!
I am currently using Fishnet but I am still confused and experiencing problems. This video solves it all also I just knew that Netcode was released because of you!!! Kudos to this Man!!!
this tutorial is extremely helpful, I just came back to unity from about a year and still not knowing too much, but I want you to know how much I appreciate you making this, I will most likely donate once I can, stay well :D
A couple ideas for multiplayer game: 1) Converting local co-op type of a game into a network type. For example "Kinduo". It's fun when each player has unique role and abilities. Or another fun one would be Chip 'n Dale Rescue Rangers 2 on NES. There you can pick up and throw items and each other etc. 2) A co-op quest type of a game. What I mean is - npcs in a world that give quests to players, and then players can group together to do the quest. Quest type can be for example to collect/find items in the world towards a common pool.
Love The tutorial! An mini FPS with netcode for objects will be gold for your channel! because the most searched tutorials on youtube for unity are FPS.
Thank you so much for creating these tutorials and providing them to us for free! This is an amazingly well done tutorial with tons of information, provided in a very clear and straightforward way. I am currently working on a VR game and I want to add multiplayer to it. This video is a great boost to get me where I need to be. You are amazing!!
Hats off to you sir! You are doing god's work by helping us all. I hope you do more of these detailed tutorials because they are an absolute godsend and you are very in-depth 🙌 Your work is highly appreciated by so many of us :))
If you got Problems with the buttons not clickable and the host/client not spawning you need to add an event system (its for sending events to objects in the application based on input) so it looks like this: Canvas -> Event System (which you can find under UI) -> Network Manager -> (the buttons)
(sorry for my bad english) thx a lot for all the tutorials. juste a little thing : you can use $ before a string to include variables with {} in the string. example: firstName = "john"; lastName = "doe"; age = 30; debug.log($"my name is {firstName} {lastName} i'm {age} year old"; way more readable than concatenation.
Code monkey you rock! And just FYI I have purchased from your courses before, in particulate the turn based strategy game . Thanks for being such a huge asset to the community.
In case anyone else faces this: If you have an issue adding the package through Git URL, ensure you install Git first, restart unity and unity hub after doing so and you should be fine. I did not have Git installed and I kept getting an error: 'Unable To Install Package'.
Late to the party, but I found atomic console to be a free alternative to the one he's using that does the exact same thing. Once you've imported it into your project drag the prefab into your scene, then go to the inspector to set the hotkey you use to open it. When doing your tests make sure to open the consoles before attempting connections.
❤ Watch my FREE Complete Multiplayer Course th-cam.com/video/7glCsF9fv3s/w-d-xo.html
💬 This was a ton of work so I really hope you like this video! Go ahead and build some multiplayer games! Thanks!
🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
👇 Click on Show More
🔴 RELATED VIDEOS 🔴
How to use Unity Relay, Multiplayer through FIREWALL! (Unity Gaming Services) th-cam.com/video/msPNJ2cxWfw/w-d-xo.html
Join your Players in MULTIPLAYER with Lobby! (Unity Gaming Services) th-cam.com/video/-KDlEBfCBiU/w-d-xo.html
EASY Console! Run any Command! (Add Cheats, Set Gravity, Spawn Enemies Quantum Console Asset Review) th-cam.com/video/bOf6CjpuSFs/w-d-xo.html
Why you should NOT make everything PUBLIC! th-cam.com/video/pD27YuJG3L8/w-d-xo.html
What are Delegates? (C# Basics, Lambda, Action, Func) th-cam.com/video/3ZfwqWl-YI0/w-d-xo.html
How to use NEW Input System Package! (Unity Tutorial - Keyboard, Mouse, Touch, Gamepad) th-cam.com/video/Yjee_e4fICc/w-d-xo.html
What are Generics? (C# Basics) th-cam.com/video/7VlykMssZzk/w-d-xo.html
What are Value Types and Reference Types in C#? (Class vs Struct) th-cam.com/video/KGFAnwkO0Pk/w-d-xo.html
What is the DIFFERENCE between Transform and GameObject? (Unity Tutorial for Beginners) th-cam.com/video/B-dVf9wUEbg/w-d-xo.html
Kickstart your game with First and Third Person Controllers! (FREE Unity Starter Assets) th-cam.com/video/jXz5b_9z0Bc/w-d-xo.html
Free Unity Multiplayer? Backend? Monetization? What is Unity Gaming Services? th-cam.com/video/JwClCc2_zC8/w-d-xo.html
Unity Authentication in 100 SECONDS! (Log in, Anonymous, Unity Gaming Services, Cloud Save, Relay) th-cam.com/video/1KSKRaacdKE/w-d-xo.html
Quantum Console assetstore.unity.com/packages/tools/utilities/quantum-console-211046?aid=1101l96nj&pubref=ngo
FREE Third Person Controller assetstore.unity.com/packages/essentials/starter-assets-third-person-character-controller-196526?aid=1101l96nj&pubref=ngo
Great Tutorial!
Covering everything in one video is perfect!
Advenced users can easily skip to any part they need and beginners can easily look over at this video while building any game and skip to any part they need help with quickly.
One of the most perfect unity tutorials out there.
I have been using netcode for the past year, something like this is definitely what we need.
Thank you!♥️♥️♥️
"Liking" did not suffice my friend. I only wish I could have donated more in my other comment, but I'm sure opportunities for that will come later on.
dont get the sintaxis of the struct why the curly brackets is this like a new instance and a constructor with parameters. TestclientRpc
Thank you 🙏
@@jorgeabuauad Yes the curly brackets allows you to construct something and instantly set any of it's public fields, so it acts similar to a constructor in that you create and assign values at the same time
If you're having trouble with the new setup of NetworkManager's Network Prefabs Lists like I did, you need to add a NetworkPrefabsList to your project. You can do what I did and right click your Assets folder in the Project tab and click Create -> Netcode (was at the top for me) -> Network Prefabs List. Then you can add whatever Network Object to it and continue the tutorial like normal. Hope that helps.
tysm
Not all heroes wear capes
plz pin!
The default scriptable object for some reason it's auto populating for me. I'm on Unity 2021.3.25f1
You just Saved my ass thanks man!
6:10 in newer version Unity doesn't accept individual prefabs but rather a scriptable object that contains prefabs. So right click-> create->net code->network prefab list
Thanks, knew i would find solution in comments
@CodeMonkeyUnity
please pin this comment
Thanks
Thanks bro
life saver...thank u
How has this guy NOT been sponsored more? The content is absolutely brilliant, look at the time release from Netcode for Game Objects and this insanely comprehensive and easy to understand guide. I'm definitely going to be looking at getting CM's course, even if I don't fully complete them or ever look at them I know I'll be supporting one of the greatest resources to young aspiring game developers. So many thanks on behalf of so many people CM!
Many thanks for the kind words!
That’s true I bought his courses and they’re amazing plus his coding practice is so clean, understandable and makes you want to code.
True!
Isn't it importing Multiplayer sample ultilities like you did?
Well... they did give codemonkey an award. But it's true, this stuff is world class, and I can't belive its free.
Thank you! The timing of this 1.0 release could not have been better and your prompt, and stunningly complete, tutorial is already saving me a ton of headaches.
Thanks! I'm glad the video is already helping you!
How do you donate?
@@foncode101 underneath the video in the row of icons with Thumbs Up, Thumbs Down, etc. There is one called Thanks with a dollar sign in a heart. Depending on how much you're going to donate you could alternatively buy one of his courses, if you don't have them already.
Thank you so much for this! There's a severe lack of multi-player tutorials, specially of those that are free, and most importantly up to date. I was trying to send $10 with my comment but I forgot my password. I will donate when I get back home from work. Thanks again for all you do and continue the great work! We all appreciate you.
Amazing is the effort you put to explain the whole unity multiplayer as soon as it launched!
Thank you for the tutorial!😊
To those who unable to get the client to move when switching to the third/3rd person character controller. I think, the problem is duplicating Player Input component by spawning 2 prefabs with it. There are two variants that fixed this for me:
1. Switch Actions under the Player Input component attached to PlayerArmature to DefaultInputs. To do this, remove Actions object what is currently there. It will propose you to create new one to replace empty space, click this btn and create new Actions with default settings by this flow.
2. Move Player Input component and StarterAssetsinputs from PlayerArmature object to separate one. In this case you will have in scene only 1 Player Input component and they will not conflict with each other. Also do not forget to make code changes from CM.
I also struggled making the second client move.
My solution was to disable the PlayerInput component in the prefab by default and simply enable it back again (in the PlayerControllerScript) only if the current player is the owner of the object.
_playerInput = GetComponent();
if (IsOwner)
_playerInput.enabled = true;
I hope this may also help somebody.
@@blackhawk-jw6ls ...Thanks so much it worked!! ..now I can go on to the next job, cheers
@@blackhawk-jw6ls THANK YOU! You saved me so much pain and misery.
I was looking into this also and if you join as client in the editor you can see that the controller type isn't KeyboardMouse. Seems like there are multiple solutions here but in many instances this wouldn't be an issue since a client connecting from a different device would not have input conflicts. I ended up just setting the controller type directly. I would plan on creating an option for the player to set their input options in a setting screen prior to connection also.
For testing purposes:
if (_playerInput.currentControlScheme != "KeyboardMouse")
{
_playerInput.SwitchCurrentControlScheme("KeyboardMouse", Keyboard.current, Mouse.current);
}
The effort and time you put in these videos is insane! This probably took atleast 50 hours of work (including everything)
Yup it's been non-stop for over a week but I'm really happy with the final result!
@@CodeMonkeyUnity whoa! Near to a 100+ hours then I suppose. In the previous comment I didn't think about voice-overs but they do indeed take a bunch of time
I highly recommend adding ParrelSync. Developing multiplayer without it is remarkably harder (no more making builds for every test!)
Yep, seconded. It's crazy how Unity doesn't allow launching multiple instances of the game in-editor
I'm developing for VR, even with parrelsync its hard.
@@cameronbonde7348 unity 6 now allows!
Apparently now on Unity 6 you can launch multiple instances inside the editor itself.
Just getting back into network programming. Great tutorial. Also, they are moving pretty fast. The Network Variable synchronization now also supports strings.
From the bottom of my heart, thank you for this gigantic work: I don't even dare to imagine the time it took you for the search for information, the tests and the editing. I had some knowledge on Mirror, I didn't have too many difficulties to follow. Armed with this new knowledge, I will be able to progress in this area.
Thanks for the kind words!
if your client doesn't move is because in the input system is setting for Xbox Controller, in the StarterAssetsInputs script, implement a start method with these lines:
PlayerInput PlayerInput = GetComponent();
PlayerInput.SwitchCurrentControlScheme("KeyboardMouse", Keyboard.current, Mouse.current);
man you are the best
sibal you saved my life. Thank you so much. From South Korea.
I'm going to kiss you
I love u
stuck at this for 7 days :))
Amazing! I wasnt expecting a 1h tutorial with this level of quality so fast.
Dude, I've been trying to get this working for days now, and just stumbled upon your tutorial. First place where I've seen these topics actually make sense, and the steps are clear enough to follow. I hope the viewers support can help keep you going!
Thanks for the super thanks! I'm glad the video helped you! Best of luck with your game
To those unable to get the client to move when switching to the third person character controller, switch Actions under the Player Input component attached to PlayerArmature to DefaultInputs. Alternatively you can make your own InputActions file, which I had to do because for some reason DefaultInputs inverted the Y axis of my mouse input.
thank you my man
This comment should be pinned. Thank you! I was about to revert back to the capsule.
Thank you for this answer! I can't find "DefaultInputs" when I try to change "Actions". Where do I find the default inputs?
Thanks for the tip!
Just what i needed. I have been watching your videos for the past two years and trying to make my hobby as an indie a real thing. Your videos have been a great help thank you very much!
Thanks for the super thanks! Best of luck in your indie journey!
Thanks a lot
I have been trying to use Photon to make multiplayer games but now that this is released i was hyped and already seeing a video from you explaining all of it is just surreal. Keep going and don't feel down about yourself your doing amazing things most people can't.
For anyone watching this recently and trying to use the newinput system from starterassets and client is not moving, you have to disable playerinput by default and only enable it when player IsOwner, but its ideal to follow the tutorial with the given exact steps and version
This is such a great tutorial. Update for Unity 6.0 and 2024: The Network Transform component now has a dropdown for Authority Mode, and you no longer need ClientNetworkTransform.
I figured out what makes your videos so good for me. It is the pacing. I tend to skip forward in videos because there's a lot of "filler". Here, every second something is happening is actually informative, and coding is sped up. Nice :D
Thankyou!
Not only do you tell us what to do, you explain it to us, which unlike most other tutorials, allows us to fully understand and do whatever we want with the knowledge instead of directly telling exactly what to do.
Once again, thankyou, this is very useful for me as a beginner testing out unity multiplayer.
I'm glad you found the video helpful! Thanks!
If you can't add the package from git URL make sure you have git installed on your PC and after installing restart you're PC
I'm watching over and over, again and again; I believe this video not only helps me but many others like me. I would upvote this video as many times as I watch it.
I'm glad the video has helped you! Thanks!
This is an incredible resource, and will definitely be helpful to many game devs.
I would love to see you discuss: multiplayer teams that handle things like friendly fire and team spawn points, multiplayer character select screens, as well maps or something like lobby voting. There's so much untapped potential when it comes to Unity multiplayer tutorials.
This is absolutely what people need to get started with Multiplayer games in Unity. Looking forward to the Unity Gaming Services video and maybe a walkthrough of the Boss Room sample game!
For the Network Animator section 48:53, I had the same issue as other where the client wouldn't move, but the other solutions didn't work for me. To fix this I followed a stack solution. You just need to uncheck the Player Input component in the PlayerArmature, then paste the following code into the controller:
public override void OnNetworkSpawn()
{
base.OnNetworkSpawn();
if (IsOwner)
{
_playerInput = GetComponent();
_playerInput.enabled = true;
}
}
Thank you @aperson2703!
Hello, I have tried implementing this solution. Now player control works in client side. However the animation is not synchronised. Can you help me if something you have done?
Pin this
Thanks man you really saved my life
thanks
Before trying this my character could move as the host but as the client i couldn't move and the host wasn't updating. After trying this solution i can move from the client side but the movement and animation are not updating
Hyped for more videos on NGO! Specifically on the Relay topic, but also on topics regarding more advanced concepts like interpolation to hide latency, extrapolation or clientside prediction, etc.
I have tried to set up a Linux server using this tutorial. At first I failed and I had to search for a long time until I found the solution. In retrospect, this was very simple. Maybe one or the other will find this information helpful. In the NetworkManager under UnityTransport you also have to specify the IP Addresses under Server Listen Address. If in doubt just use 0.0.0.0 to use all IP addresses.
You are a gift to Unity creators everywhere! This video really helped me get over the hump with networking. I loved the bite size topics - I referred to it several times while coding my game. The biggest issue with networking for me was knowing where the data was, and getting and setting it properly - this video was instrumental in helping me make it happen. Thank you!
Nice! I'm glad the video helped! Thanks!
This by far is the best tutorial video EVER. The pace of the video is absolutely perfect! Thank you so much for this video it has helped me a ton with starting to grasp this concept / side of unity. I can't wait for the future episodes!!!
I'm glad you liked it! Thanks!
I mean Brackeys was perfect and all but content of Code Monkey is somewhere else. Responding to comments, creating tutorial shortly after release.. Currently the best game dev channel. Should acquire more attention.
Thanks for the kind words!
Again, thank you so very much for this amazing content!
Thanks for the Super Thanks!
Thanks a lot!! A one hour tutorial turned into about 8~10 hours work because I kept going off on tangents learning and experimenting but the best way to learn, cheers!
I've been trying and failing for months to figure out search algorithms and data structures for turn-based strategy game, so I jumped at your course the moment I saw it. Easiest $20 I ever spent.
I hope you're enjoying it! Thanks!
@@CodeMonkeyUnity I really like the challenges where you have us pause and try and work out the solution ourselves. It's really rewarding to solve a problem on your own.
Honestly, I don't regret subscribing - this is EXACTLY what I was looking for.
Same :D
I'm glad you found the video helpful!
Boi, first of all thanks for the turnbase game course, bought it and it was top quality. Second of all, as someone from IT, I respect you for takeing the time to get familiar with networking just to help your viewers. Much respect and keep up the good and quality work 🥳🥳
Thanks! I'm glad you enjoyed the course!
At 26:30, you would want to limit reading in cases where one person has info that no one else should know from the server. Think of like Among Us, some player is the saboteur and the rest are running around as innocents doing tasks. No one else needs to know who the saboteur is on the client side. In our game we had to lock down a lot of stuff like that because of cheaters and hackers using that sort of info to their advantage.
Oh you're right. I was thinking "if only the owner can read why make it a NetworkVariable at all?" and yeah the answer is for any knowledge that you want both the Server and just that one specific Client to know about.
For just the Server or just the Client you would only need a non-networked variable, but for some knowledge that only those 2 know then yup I guess that's the use case.
Thanks!
I just went to unity's Offishall Unite2022 conf. in Austin tx. and they recommended your video to learn netcode for game objects. you are a Rockstar.
Oh wow really? That's awesome to hear, I'm glad people find the video helpful!
For anyone that is facing an issue with the client not moving at all, just import any other character asset with animations and attach the PlayerNetwork script to that character. The third-person starter asset was not working for me so I tried doing this and this worked.
Cheers
How can you please a bit in depth? I am also having the issues with third person controller
Are you using Root motion? If so then yes motion will be linked to animations, but if you have the animations set up like I have in the demo, with no root motion, then there's no link between animations and position
@@CodeMonkeyUnity The issue is animations are syncrhonized whenever I go back to client it works fine, when to turn back to host, it does not change to its cinemachine camera I can control character but with seeing client's view
@@CodeMonkeyUnity tried to get the cinemachine.Follow = transform.GetChild(0); which refers to the playerArmature, it still does not work :((
@@perspectives2202 I imported another character asset with different animations and set up the running animations manually
then I followed all steps of the video like adding network object etc and it worked
This video is insane! Amazing work!
So much detailed! I learned a lot!
I would be amazing if you would expand this tutorial to make a mini game!
I have yo say that I expected this tutorial to be a payed tutorial, so I appreciate that you made this video for free! But I would also bought it or the expansion of this tutorial.
Thank you so much for all your effort!
Can you PLEASE make a tutorial on picking up, holding, using, and dropping items in multiplayer? Parenting is seemingly impossible with Netcode and I feel like you could figure it out! A p2p tutorial would also be awesome! Thanks!
OMG this is so good! you make probably the most detailed videos in the Unity TH-cam. I would love a tutorial like this for a simple turn based game (cards, classic JRPG or something like that) with a dedicated server.
honestly the best soft tutorial ive ever seen. short and straight to the point ! i love it
Simply the best tutorial I ever see, even a begginer like me can understand very much of it.
Love the content Codemonkey! As of 8.12.22, NC4GO supports strings and gameobjects and such in NetworkVariables. Love the content!
Oh that's great, thanks for the update!
Any plans on making a full course on multiplayer? I'm currently enrolled in your turn based course and i'm really enjoying it, you're helping me build the game of my dreams! thanks a lot man!
I would love to but courses take a ton of time to make so not sure if I can, I'm researching if I can make something on a smaller scale that wouldn't take several months to build
Appreciate how fast you got this video out!
I've been working non-stop this past week but I'm really happy with the final result!
seems like code monkey should be sponsored more! Like DUDE! THIS IS AWESOMEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!!! its really detailed and i can understand it even if i have no networking experience and easy to learn with Code Monkey's Teaching style which is just talking and talking about the important stuff and nothing else!
Its also SUPER beginner friendly!
For everyone facing the issue with the client not moving after you added the third-person controller. The issue is the new Input System, it does map the same input system on the host and on the clients so to fix this issue write: _playerInput.enabled = true; after the if(!IsOwner) return; what this does it maps the Input system on the client which is the owner.
Code example:
private void Update()
{
if (!IsOwner) return;
_playerInput.enabled = true; //this line of code is what you are missing to fix the issue
....
}
Have anyone else had the issue where the ThirdPersonController does not work on the client? Up until 49:39 everything works, but then I cannot move with the client. I've added the " if(!isOwner) return; " in ThirdPersonController script , I've got ClientNetworkTransform syncing positions, and I've added the player prefab to the NetworkManager. pls help :3
Edit: The problem seems to be the PlayerInput which auto-selects a Control Scheme other than KeyboardMouse. Connecting a gamepad solved that temporarily.
Player Input->Actions=DefaultInputActions
@@daledroesse8279 where this line should be added? in the "FirstPersonController" script of the StarterAssets?
Thanks!
Many thanks for the super thanks! I'm glad you found the video helpful!
Check out the free course if you want to see this implemented in a full project th-cam.com/video/7glCsF9fv3s/w-d-xo.html
Hey, I'm having a problem when using multiple camera's. How would I go about fixing this? I cannot seem to get clients to ignore other camera's that are within the scene. Any help is appreciated
What problem? Are you using Cinemachine? If so you need to make sure the local player, with IsOwner true is the only one with a Virtual Camera.
Either destroy the virtual camera on the other players or lower their priority.
@@CodeMonkeyUnity I am not using Cinemachine, however, I've tried lowering the priority and couldn't get that to work so I'll try destroying other players cameras.Thank you for your help.
@@Sk8_ did you ever find a fix to this? Cant find any solutions to having the FPScams be separated under Playerprefab
You are the best, covering the theories from Networking and explaining how the code is working is what very less tutorials do. They don't usually explain "How it works?".
People like you are simply the best. Thank you for sharing your knowledge and helping us all learn!
[Netcode] [DestinationState To Transition Info] Layer (0) does not exist! how to fix it
I have the same error and can't seem to find a fix. I will be waiting here with you :D
Same here
Hello, I fixed this by using blend trees to transition between animations.
Great video, however I still encountered an issue, I am using standart Third Person controller and my client still not moving even after I put Client network transform on it (.
EDIT: okay, small update here, I... think at least, I was able to streamline the problem and the it seams like client simply not able to edit any variable even though Client Network transform is on object AND Server authority turned off.
EDIT2: please show how to encorporate this netcode with Starter Assets input (Third person), this thing is giving me so much headache it is just crazy.
I had the same problem. I noticed that the Control Scheme of the player input was set to Xbox Controller on the client but was set on keyboard/mouse on the server. So I forced the control scheme of player input using the method SwitchCurrentControlScheme of the PlayerInput and it's now working as expected. I have no idea why the second player added was set to Xbox Controller.. There might be a better solution.
@@Groumpif YEAH, for real, I just tried to plug in my XBOX controller and now client can move... thanks for the hint brother.
@@Groumpif I know you wrote this months ago but thanks so much for this reply. Just saved me a lot of headache figuring out why my clients wouldn't move with mouse and keyboard.
Coming back to this video months later when starting another multiplayer project. it made me feel good you still active and helping people. Most helpful content creator I ever seen
Thanks! Best of luck with your new project!
You are literally the best. I wanted to make a multiplayer game really bad and considered photon but its kinda outdated. This couldnt have gone any better. Thank you for your contribution
In unity 6 you dont need the Client Network Transform in the Network Transform you can choose between
Owner authority and Server authority
Oh that's great to know! Nice change!
Thanks a lot for the video! I didn't realize networking could be so simple. This makes developping multiplayer games less intimidating.
Thanks for the super thanks! Yeah nowadays thanks to these awesome tools it is insanely easy to make multiplayer games compared to how it was previously. Best of luck with your games!
been watching this channel videos and always wonder how one person would developed this much GODSENT SKILL of simplifying and instructing complex things.
Thanks for the kind words! I'm always trying to improve the way I teach, I believe I've improved quite a lot since my first video 5 years ago, who knows where I'll be in 5 more!
Already made a game with NGO, but I must admit, this video would have helped me a lot.
I'm really waiting for the next video about all topics around relay, lobby, matchmaker and game server hosting
Not everyone dedicates their time and effort researching and putting these together, not to mention the hassle of always building and running unity to test server and clients. That parallelsync extension really comes in handy.
Amazing video! Thanks a lot for your work 🙏🏼! Now I understand way better how to use NetCode for Game Objects and my goal to create a turn-based multiplayer game seems even more realizable to me.
THANK YOU SO MUCH FOR EXPLAING SERVERRPC AND CLIENTRPC YOU JUST SAVED MY GAME
From experience most tutorials make things look way easier than when you get into trying it yourself. You did a A1 job of making this look as easy as possible. :D
I'm not using a regular movement system in my game, so I got a bit ahead of you and got so worked up about how I was going to do the variables when they were set inside an if owner thing.
Then I watched 10 more seconds
Thank you Hugo for explaining complex topics on fingers
¡Gracias! You can't fathom how much I love you my man. You ever hit northern mexico, you've got a friend you can count on. Always.
I can't really put it into words my friend. The amount of effort, the speed in which you did all this, the details and just everything. I don't feel appreciated as "audience" I feel as if my older brother had stayed up all night to help me study a difficult subject. I can't really see you as a content creator after witnessing this amount of effort and dedication to us.
You are truly a great friend, and an amazing person.
Many thanks for the kind words! I'm glad you like the videos!
This is so cool! I finally bought a synty asset for my next game coming, and it is going to feature local multiplayer. This video will be very helpful. I'll watch it very early tomorrow morning before getting ready for the day.
Thank you Mr Code Monkey! You rock!!
I am currently using Fishnet but I am still confused and experiencing problems. This video solves it all also I just knew that Netcode was released because of you!!! Kudos to this Man!!!
You are a hero. A warrior. One day, I hope we shall be brothers in keyboard arms.
This looks SO much easier than any previous way you had to do networking. Compared to Mirror and Photon this is extremely easy!
Finding a video made by you on a new topic I'm trying to learn is the best, always top quality, thank you so much!
I'm glad you found my videos helpful! Thanks!
this tutorial is extremely helpful, I just came back to unity from about a year and still not knowing too much, but I want you to know how much I appreciate you making this, I will most likely donate once I can, stay well :D
I'm glad you found it helpful! Thanks!
I just started to learn Unity. I feel so lucky that I found your channel and learning a lot from it!
I'm glad my videos have helped, best of luck in your learning journey!
I just can't wait for the relay and lobby video(s) ! Good job as always CodeMonkey!
Unbelievable. You have out-done yourself CM. Amazing work! Thanks a million as always.
*THE BEST tutorial for networking! it has teached me EVERYTHING that i need for networking in unity! very nice tutorial!*
I'm glad you found it helpful! Thanks!
@@CodeMonkeyUnity you are welcome! (hello i am a very big fan of you!)
A couple ideas for multiplayer game:
1) Converting local co-op type of a game into a network type. For example "Kinduo". It's fun when each player has unique role and abilities.
Or another fun one would be Chip 'n Dale Rescue Rangers 2 on NES. There you can pick up and throw items and each other etc.
2) A co-op quest type of a game. What I mean is - npcs in a world that give quests to players, and then players can group together to do the quest. Quest type can be for example to collect/find items in the world towards a common pool.
Love The tutorial!
An mini FPS with netcode for objects will be gold for your channel! because the most searched tutorials on youtube for unity are FPS.
Thank you so much for creating these tutorials and providing them to us for free! This is an amazingly well done tutorial with tons of information, provided in a very clear and straightforward way. I am currently working on a VR game and I want to add multiplayer to it. This video is a great boost to get me where I need to be. You are amazing!!
I'm glad you found the video helpful! Thanks!
Hats off to you sir! You are doing god's work by helping us all. I hope you do more of these detailed tutorials because they are an absolute godsend and you are very in-depth 🙌 Your work is highly appreciated by so many of us :))
If you got Problems with the buttons not clickable and the host/client not spawning you need to add an event system (its for sending events to objects in the application based on input) so it looks like this: Canvas -> Event System (which you can find under UI) -> Network Manager -> (the buttons)
describe you Problem if not fixed@@Troutdaddy-ub7gi
Wow this course is amazing. I am a beginer and I can even understand this all.
you sir are a hero. i appreciate your effort to be so quick about it. i believe you are the firist to bring a quality tutorial on youtube about it. :D
THANK YOU MY BROTHER FROM ANOTHER COUNTRY AND ANOTHER FAMILY!!!
This is the best online tutorial.
Thank you, Code Monkey! Haven't tinkered in Unity for about a year and it's nice to have some steady guidance on my return.
(sorry for my bad english)
thx a lot for all the tutorials.
juste a little thing : you can use $ before a string to include variables with {} in the string.
example:
firstName = "john";
lastName = "doe";
age = 30;
debug.log($"my name is {firstName} {lastName} i'm {age} year old";
way more readable than concatenation.
Yup I know, I've just been using concatenation for decades now so I just do it automatically
I'm learning english just to elaborate more complex acknowledgments for this channel
Code monkey you rock!
And just FYI I have purchased from your courses before, in particulate the turn based strategy game . Thanks for being such a huge asset to the community.
Thanks! I hope you enjoyed the course!
In case anyone else faces this: If you have an issue adding the package through Git URL, ensure you install Git first, restart unity and unity hub after doing so and you should be fine. I did not have Git installed and I kept getting an error: 'Unable To Install Package'.
Thank you very much. Exactly time when I slowly start to look in direction of multiplayer
Dude, you are a GOD, My game will have a section on credits just for u, jeez
Bloody Legend. I seriously feel a load better after watching this. You are a good teacher
I'm glad the video helped you! Thanks!
I actually thought this tutorial would be for some more advanced programmers. But you actually explained everything extremly well :D.
I'm glad you found it easy to understand! Thanks!
definitely the best unity related tutorial I have ever seen.
Late to the party, but I found atomic console to be a free alternative to the one he's using that does the exact same thing. Once you've imported it into your project drag the prefab into your scene, then go to the inspector to set the hotkey you use to open it. When doing your tests make sure to open the consoles before attempting connections.