Multiplayer In Unity Made Simple || Netcode For GameObjects #1

Поділитися
Вставка
  • Опубліковано 29 січ 2025

КОМЕНТАРІ • 73

  • @braindead2813
    @braindead2813 11 місяців тому +11

    Dude hats off for making a tutorial on this. Probably like 2 or 3 good ones out there now there are 4. Thank you!

    • @freedomcoding
      @freedomcoding  10 місяців тому +1

      I am glad it was useful. Thank you too!

    • @nwabugwudumebi
      @nwabugwudumebi 3 місяці тому +1

      Hey, Can you Tag The other 3?

  • @s.w.e.d.3057
    @s.w.e.d.3057 11 місяців тому +7

    LMAO! dude. I was just thinking. Why is every tutorial of netcode s weird. I just want a diagram of the overall process and how each componet is assembled in a blueprint manner not just a 'write this and now it works'
    100% satisfaction. subcribed

    • @freedomcoding
      @freedomcoding  11 місяців тому

      Thanks, I am glad you liked it!

  • @GocoYT
    @GocoYT 7 місяців тому +1

    Awesome video. I am developing games for many years and gone through tutorial hell before. But this was so clear, concise and to the point. Really well explained, thanks for the help!

  • @takacao8373
    @takacao8373 11 місяців тому +1

    awesome. Can't wait for the server authoritative approach!

  • @Birdscolony211
    @Birdscolony211 Місяць тому

    Great tutorial ❤️ Finally Got all Answer about all my questions from this video 😮‍💨 please make more tutorials about multiplayer game dev from scratch ❤️❤️

    • @freedomcoding
      @freedomcoding  Місяць тому

      Nice! I will probably get back to multiplayer some time in the future.

  • @DiggityDave28
    @DiggityDave28 9 місяців тому +2

    Great tutorial! Your video is very useful, organized, and easy to follow. Awesome job!

  • @castlecodersltd
    @castlecodersltd 6 місяців тому +1

    Thanks for this, there was a couple of things I'd not considered until watching it 🙂

  • @PotatoManager420
    @PotatoManager420 7 місяців тому +3

    Nice and comprehensive video!

  • @Melmsie
    @Melmsie 11 місяців тому +4

    Would steam be a better thing to use if you're only planning to release on steam anyway?

    • @freedomcoding
      @freedomcoding  11 місяців тому +3

      I am not sure if Steam provides servers. Because the Netcode for GameObjects logic is separated from the transport layer, you should be able to use it with any server.

    • @Mosopia
      @Mosopia 5 місяців тому

      @@freedomcoding I think steam have only peer to peer...

  • @flamart9703
    @flamart9703 11 місяців тому +1

    I saved this video in playlist for later, first need to do single player. :)

    • @freedomcoding
      @freedomcoding  11 місяців тому +1

      Great. Good luck!

    • @flamart9703
      @flamart9703 11 місяців тому

      ​@@freedomcodingThank you! By the way, are you working on your game/games or you do only tutorials?

  • @disobedientdolphin
    @disobedientdolphin 11 місяців тому

    Very cool video! I really like how easy that is.

  • @hernandonj
    @hernandonj 4 місяці тому

    Great video. Thank you so much!

  • @NavanBethrax
    @NavanBethrax 11 місяців тому +3

    I'm curious how this whole concept could be applied to games without a player controlled character. Let's say a card game, where the players don't control a character but all have a different hand of cards displayed to them. Do you think games like card games, text adventures or turn based fighting games could be implemented using Netcode for GameObjects ?

    • @freedomcoding
      @freedomcoding  11 місяців тому +2

      You can make pretty much any game (up to 16 players) with NGO. You dont have to assign the player prefab or you can have just some player manager script without a sprite etc.

  • @rootbindev
    @rootbindev 9 місяців тому

    Nice work mate!

  • @baydanemre
    @baydanemre 7 місяців тому

    What if we have 2 different prefabs, i mean it’s like first one is blue player (host) second one red player (client)and both are different prefabs, then how it works

    • @freedomcoding
      @freedomcoding  7 місяців тому

      The simple way would be to keep the same prefab and just change color of the material if it is client.

    • @baydanemre
      @baydanemre 7 місяців тому

      @@freedomcoding what if we have completely different models

    • @freedomcoding
      @freedomcoding  6 місяців тому

      @@baydanemre Then you could change the model the same way.

    • @smudjer6
      @smudjer6 6 місяців тому

      @@freedomcoding could you do the same thing with say a canvas? if I wanted the players to have separate UI elements?

  • @LittleSuccubusGames
    @LittleSuccubusGames 7 місяців тому

    how you you go about to add different "sprite" for different player ? it's something i always wanted to do in a mutiplayer game.

    • @freedomcoding
      @freedomcoding  7 місяців тому

      On each player you can store a NetworkVariable containing some ID or index of the sprite that the player selected. Then you can change the sprite of the SpriteRenderer based on that variable.

  • @rexgatling4891
    @rexgatling4891 8 місяців тому

    I am trying to sync the state of the mesh renderer on a material using NetCode. Would you be able to help with that?

    • @freedomcoding
      @freedomcoding  8 місяців тому +1

      Yes that could be done using NetworkVariable. Just pass the data you are trying to sync and if a float or int isn't enough, you can create class holding that data. That will need to inherit from INetworkSerializable.

  • @ulyssedadon2229
    @ulyssedadon2229 2 місяці тому

    Hey, really good video but i have a question. When i move an object with my Player1, my player2 is not seeing that objet moving. Do you know how i can fix that?

    • @freedomcoding
      @freedomcoding  2 місяці тому

      Hi, I am glad you liked it. Did you set the player prefab in the NetworkManager or are you instantiating the players in a different way? Do you have the NetworkObject and ClientNetworkTransform components attached on the players?

  • @MR.OOFproductions
    @MR.OOFproductions 7 місяців тому

    This might sound like a dumb question because I’m new to all this but Is this only for pc and 2D games? Because I want to use this for a 3D car game on mobile is it possible?

    • @freedomcoding
      @freedomcoding  6 місяців тому

      That is something I forgot to mention. You can use NGO with any type of game on any device.

  • @GamebyYash
    @GamebyYash 10 місяців тому

    hey man love it but i want to create a local host for android in which ip address of host will be added automatically or makin a local multiplayer that connect both on pc and android help me with this concept really want to learn also make a course love to purchase

    • @freedomcoding
      @freedomcoding  10 місяців тому

      Hi, you can use Relay for that. I made a tutorial on it recently. I will see about making online course. Thanks for the idea!

  • @sagarhm2237
    @sagarhm2237 9 місяців тому

    Hey bro can do one tutorail how use aws ec2 for unity netcode multiplayer .

    • @freedomcoding
      @freedomcoding  9 місяців тому

      Hi, that is not on my list currently.

  • @JanDevPL
    @JanDevPL 11 місяців тому

    Will you make a video showing how to connect multiplayer with Steam?

    • @freedomcoding
      @freedomcoding  11 місяців тому

      I think I would have to publish a game to Steam for that... I will see.

  • @JanDevPL
    @JanDevPL 11 місяців тому

    Good video!

  • @AlcadraSoykan
    @AlcadraSoykan 5 місяців тому

    teach us how to use steam transport pls!

    • @freedomcoding
      @freedomcoding  5 місяців тому +1

      I put it to my list. Maybe some time in the future.

  • @Freno.99
    @Freno.99 5 місяців тому

    for some reason it tells me when i build the game that NetworkBehaviour doesn't exist

    • @freedomcoding
      @freedomcoding  5 місяців тому

      So you are getting the error in Unity or in a log of the build? What exactly does the error say?

  • @vanshtandon1829
    @vanshtandon1829 2 дні тому

    How the other client know he want to start as a client?

    • @freedomcoding
      @freedomcoding  День тому

      What exactly do you mean by that?

    • @vanshtandon1829
      @vanshtandon1829 22 години тому

      @@freedomcoding like i want to make 1 "Play" button. And first client will check if any room is there then start as a client, And if no room is there then start as a host.

    • @freedomcoding
      @freedomcoding  13 годин тому

      @@vanshtandon1829 You can try to first join as a client (NetworkManager.Singleton.StartClient();) and then after some delay (2 sec or so) check if the user is connected (NetworkManager.Singleton.IsConnectedClient). If they are not, you can start as a host (NetworkManager.Singleton.StartHost();). I hope this helps!

  • @mumtaz4224
    @mumtaz4224 2 місяці тому

    16 player ? isn it 50 ccu ? it might can be 50 player in one room ?

    • @freedomcoding
      @freedomcoding  2 місяці тому +1

      Hi, there isn't any max number for ccu as far as I am aware. 16 is only a recommendation, but it can surely support more than that. It mainly depends on the amount of data you need to transfer through the network.

  • @StarDynamics
    @StarDynamics 11 місяців тому

    Netcode for gameobjects is not simple at all when it comes to client-predicted server authoritative movement cause it doesn't have one. Good luck with that and see you using fishnet or Netcode for entities soon or even Unreal Engine 😅

    • @freedomcoding
      @freedomcoding  11 місяців тому

      Yeah there is certainly more complicated stuff, but it is simple to setup for non-competetive games. I will get to Netcode for entities some time :D

    • @StarDynamics
      @StarDynamics 11 місяців тому

      @@freedomcoding Good luck mate . btw , I liked your dots tutorials

    • @freedomcoding
      @freedomcoding  11 місяців тому

      @@StarDynamics Thanks, good luck to you too! I am glad you liked them.

  • @sumi2494
    @sumi2494 9 місяців тому

    Only 16 players in a session?

    • @freedomcoding
      @freedomcoding  9 місяців тому +1

      16 players is just a suggestion by Unity. If you plan to have more, you should use Netcode for entities.

  • @Rm518ji
    @Rm518ji 8 місяців тому

    please add subtitile hindi

    • @freedomcoding
      @freedomcoding  8 місяців тому

      You should be able to auto-translate it by clicking on the gear icon and going to subtitles.

    • @Rm518ji
      @Rm518ji 8 місяців тому

      @@freedomcoding no options are avilable only english

    • @Rm518ji
      @Rm518ji 8 місяців тому

      @@freedomcoding please add this like mr,.. bisht