How To Make A Multiplayer Game In Unity - Lobby - Main Menu

Поділитися
Вставка
  • Опубліковано 1 жов 2024

КОМЕНТАРІ • 346

  • @borisgolubovic4533
    @borisgolubovic4533 4 роки тому +130

    What I reccomend for ur clips to use diffrent workflow or order when u record this tutorials, first show us UI then code. This way u keeping trowing new files and scipts, but when u create it I do not know why do u need that new script, so script doesnt make sense until I see UI and then I need to scroll through scipts again to understand why I wrote some methods. In this alternative I will understand it first time, while I am writting code. But thank u for ur work anyway, keep going :D

    • @realefrain7179
      @realefrain7179 3 роки тому +1

      Yeah I think he should do the UI first before the scripts, because I gave up right after the UI

    • @chaoticdanor
      @chaoticdanor 3 роки тому +4

      I second this because our UI is usually different from your UI and it's better to know in advance what parts of your code we should ignore and it's also really confusing when you mention all these different scripts but we don't even have a visual representation yet of why we are doing it this way, this does cause us to have to jump back and forth a lot.
      Thanks for these excellent tutorials, hope you don't mind our feedback.

  • @osumoment
    @osumoment 3 роки тому +19

    The fact that u have every program on your taskbar open (even league of legends) triggers me XD

  • @Steve-gi2yj
    @Steve-gi2yj 3 роки тому +26

    BIG thank you to stefan429, he is right, well the things he mentioned in his comment:
    if youre having issues, MAKE SURE:
    1. your networkManager has the roomPlayer prefab assigned at the bottom
    2. youre using path instead of name for checking the active scene in both OnServerConnect AND OnServerAddPlayer in NetworkManagerLobby, i.e. SceneManager.GetActiveScene().path
    so for number 2, in detail, in the youtube tutorial, it shows:
    if(SceneManager.GetActiveScene().name != menuScene)
    {
    conn.Disconnect();
    return;
    }
    BUT you need to change it to:
    if(SceneManager.GetActiveScene().path != menuScene)
    {
    conn.Disconnect();
    return;
    }
    that fixed the problem... ONE LAST thing i am trying to figure out, is my lobby, the Roomplayer prefabs never show up on the Left side that shows the tree and the objects... not sure why :(

    • @iangraham6730
      @iangraham6730 2 роки тому +1

      Thanks man!

    • @abdullahshafqat772
      @abdullahshafqat772 2 роки тому +1

      Helpful comment upvoted!

    • @meddjihed9108
      @meddjihed9108 2 роки тому +1

      same problem, when a client joins the lobby it sais : server disconnect, connection id1, please let me know if you've solved the problem

    • @shubhamdhumal6854
      @shubhamdhumal6854 Рік тому +1

      @@meddjihed9108 If you have the bug where Roomplayer doesn't get instanciated:
      NetworkManagerLobby.menuScene doesn't get converted to the rigth string, so
      if (SceneManager.GetActiveScene().name == menuScene)
      won't be true.
      Fix this by making
      [SerializeField] string menuScene;
      And type in the scene name in the inspector instead of dragging in the scene.
      Used Unity 2020.1.6f1
      Credit:- @Julian Röckl

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

      Life saver !

  • @ZLGaming140
    @ZLGaming140 4 роки тому +7

    public void SetPlayerName(string name)
    {
    continueButton.interactable = !string.IsNullOrEmpty(name);
    }
    this line of code is broken for no reason. But it got fixed with
    public void SetPlayerName(string name)
    {
    continueButton.interactable = nameInputField.text.Length >= 4;
    }
    I do not know why it got fixed

    • @jimmyjones3200
      @jimmyjones3200 3 роки тому +1

      Thank you

    • @andrevieira5754
      @andrevieira5754 3 роки тому

      thanks kkk

    • @rustomamameng
      @rustomamameng 3 роки тому

      You can change the line below to make "continueButton.interactable = !string.IsNullOrEmpty(name);" work
      private void SetInputField()
      {
      if(!PlayerPrefs.HasKey(PlayerPrefsNameKey)) { return; }
      string defaultName = PlayerPrefs.GetString(PlayerPrefsNameKey);
      nameInputField.text = defaultName;
      SetPlayerName(defaultName);
      }
      to
      private void SetInputField()
      {
      if(!PlayerPrefs.HasKey(PlayerPrefsNameKey)) { nameInputField.onValueChanged.AddListener(delegate { SetPlayerName(nameInputField.text); }); ; return; }
      string defaultName = PlayerPrefs.GetString(PlayerPrefsNameKey);
      nameInputField.text = defaultName;
      SetPlayerName(defaultName);
      }

  • @echophantom8511
    @echophantom8511 3 роки тому +16

    I think it would be better if you wrote the code in front of us so that we can see all the code and understand what is happening in the code

  • @julianrockl4228
    @julianrockl4228 4 роки тому +15

    If you have the bug where Roomplayer doesn't get instanciated:
    NetworkManagerLobby.menuScene doesn't get converted to the rigth string, so
    if (SceneManager.GetActiveScene().name == menuScene)
    won't be true.
    Fix this by making
    [SerializeField] string menuScene;
    And type in the scene name in the inspector instead of dragging in the scene.
    Used Unity 2020.1.6f1

    • @DefineDoddy
      @DefineDoddy 4 роки тому +2

      Thank you so much! I wonder if this is a bug or if it's just a weird way Unity handles the string from a scene.

    • @blacksky788
      @blacksky788 3 роки тому +2

      thank you mate :) This fixed my issue.

    • @fadhil0o0o0
      @fadhil0o0o0 3 роки тому +2

      alternatively, you could use GetActiveScene().path instead of the `name`, because the menuScene variable returns the asset path instead of asset name.

    • @tidestormstudios4254
      @tidestormstudios4254 3 роки тому

      @@fadhil0o0o0 Sonds like a better solution, didn't knew that. Thanks for pointing it out!

    • @rubycart123
      @rubycart123 2 роки тому

      thank you so much, this was the issue i had for so long

  • @chrolloace2032
    @chrolloace2032 4 роки тому +10

    Its a really good tutorial but you should explain more thoroughly or go slower , i was stuck trying to figure out why my intelisense would not recognize the event action bit and in the end i realized is because i was missing using system. But overall a really great tutorial man.

    • @marie2982
      @marie2982 4 роки тому

      Thank you. This comment helped me a lot, I had the same issue.

    • @MissMoonlightStreak
      @MissMoonlightStreak 4 роки тому

      Make sure you check out the project in github too - that's how I fixed all my missed imports that were throwing errors :) my ide is awful at picking up intellisense haha

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

    ClientScene was merged into NetworkClient on the mirror docs

  • @ahmadhussain309
    @ahmadhussain309 4 роки тому +12

    what was the first game you created when you were beginner?
    BTW i loved this tutorial :)

  • @MrMrjacky7
    @MrMrjacky7 4 роки тому +5

    I'm following your wonderful series (which you said it is not a series ahahah), anyways, is there the possibility to create multiple lobbies contemporarily to which the users can connect by a name or an ID? I mean private lobbies for groups of people

  • @tylerread5907
    @tylerread5907 4 роки тому +8

    Would love some help - My unity player launches the lobby fine when I host, when I join the localhost on the build version it joins but all it says is "Lobby Tutorial" it doesn't create another player. I'm not getting any errors. Thoughts?

    • @StevenPaw209
      @StevenPaw209 4 роки тому

      I have exactly the same problem. Its even saying in the console, that another player joined

    • @tanh8285
      @tanh8285 4 роки тому

      @@davidandrestorresbetancour6527 Thanks!

    • @EUZERU
      @EUZERU 4 роки тому

      same problem

  • @jackjacky4587
    @jackjacky4587 4 роки тому +6

    i'm having trouble navigating the Git Hub page, many files seem to be deleted, is it a mistake on my part?
    thank you very much for this tutorial

  • @cauejanzinic.6263
    @cauejanzinic.6263 2 роки тому +2

    Guys help me, my "Empty" object is not spawning, and neither is the "NetworkGamePlayerLobby" prefab. It's all set right in NetworkManager.
    if anyone knows please help me.

  • @crazyguy1212
    @crazyguy1212 4 роки тому +8

    How do I make rooms available from the server, when clients connect to the server will see those rooms?

  • @neomagic8076
    @neomagic8076 Рік тому +1

    if I host a game on unity my roomplayer instantiated but if ıtry to join a game in build another room player couldn't instantiate. Can someone help me

  • @Benjackalope
    @Benjackalope 3 роки тому +23

    I get a little lost, trying to figure out what code we are supposed to create, and what code comes with Mirror. I definitely love it when you show us your screen while you type it out.
    Either way it is a great tutorial, and definitely helps us create a network lobby without any experience. Thank you!

    • @akarsh9407
      @akarsh9407 3 роки тому +1

      Yeah i also Like him while Explaining and Typing but its okey

  • @FireJojoBoy
    @FireJojoBoy 4 роки тому +6

    [Solved]
    it seems like everything with the connection and UI works, but i cant see the roomplayer objects. yes i assigned them in the inspector of the network manager
    Edit: i wrote the Function for the Host not for the client xD

    • @Snerlerx
      @Snerlerx 4 роки тому

      I think I'm having the same problem, which function are you referring to?

    • @FireJojoBoy
      @FireJojoBoy 4 роки тому

      @@Snerlerx it was the OnStartHost function, you have to change it to OnStartClient

    • @Snerlerx
      @Snerlerx 4 роки тому +1

      @@FireJojoBoy Didnt work :/ thanks anyway

    • @FireJojoBoy
      @FireJojoBoy 4 роки тому +3

      @@Snerlerx have you tried changing the getActiveScene.name to getActiveScene.path ?

  • @gameloft136
    @gameloft136 4 місяці тому +1

    How to make sure that players create all lobbies on one server, and not connect via IP?

  • @linn1133
    @linn1133 3 роки тому +5

    thanks for the great tut! I'm having a really weird issue, where i am trying to override methods from the NetworkManager but it says that no suitable method can be found. I swear I'm inheriting from the base class correctly

    • @linn1133
      @linn1133 3 роки тому +3

      Okay, I solved the problem for anyone who might be interested, the problem was that i had another package installed (called rasa, a chatbot framework) which also had a class called NetworkManager which I was inheriting from. Oops

    • @LaytonBusse
      @LaytonBusse Рік тому

      I have the same issue but I dont have any packages like that and I dont know what to do or how to check for any packages that might have that

  • @thewalrus2035
    @thewalrus2035 3 роки тому +3

    It would appear there is no function called OnClientConnect() in the class NetworkBehaviour. Has it been removed in some update since this video, or has it changed name?

    • @X_TYR_X
      @X_TYR_X 3 роки тому +2

      change the NetworkBehaviour to NetworkManager

    • @thewalrus2035
      @thewalrus2035 3 роки тому +1

      @@X_TYR_X Alright, thank you!

  • @coolerbast1
    @coolerbast1 4 роки тому +2

    You are to fast to be able to understand what you have to do

  • @baldursthones6542
    @baldursthones6542 2 роки тому +3

    ClientScene was merged into NetworkClient on the mirror docs

  • @JohnSmith-pg5vv
    @JohnSmith-pg5vv 4 роки тому +12

    Whenever I join lobby on my remote build after hosting a lobby it connects, creates player, than instantly disconnects. It goes onEnable, joinLobby, onStartClient, onClientConnect, handleClientConnected, onDisable, onClientDisconnect. Did anyone have a similar issue?

    • @Imdad6629
      @Imdad6629 3 роки тому

      Having the same issue, has anybody found a solution to this problem? The roomplayer gets instantiated on host but as when I go to join on a different computer the OnServerAddPlayer() method is not even called, I then am promptly disconnected.

    • @JOHNSMITH-sj3lg
      @JOHNSMITH-sj3lg 3 роки тому +1

      @@Imdad6629 I have solved the problem with me hope it can help you and also the others if someone has the same problem. so go to the game object "NetworkManager" where you also have the NetworkManagerLobby script on it, with me has there always automatically created the Kcp transport that's wrong delet it. search for "Telepathy Transport" at component and link it in the inspector in the NetworkManagerLobby script.(my english is not so good i hope it helps u out :)

  • @jaydenpatton2783
    @jaydenpatton2783 Рік тому +1

    After following this video and the next one in the playlist, I'm having trouble connecting a client to the host. I've ensure the transport IP is localhost, but still no results.
    If it helps, the logs show the host accepting the connection and then the client immediately disconnects. On the flip side when running a client in editor and attempting to join the lobby by specifying "localhost", the only message that appears is a timeout message.
    Any ideas what could be going on here?

    • @jaydenpatton2783
      @jaydenpatton2783 Рік тому +1

      I actually solved the issue on my own after taking a break and coming back to this. The menuScene variable doesn't store the correct value. I simply hard-coded it to the value of "Scene_Lobby" to get it to work. Hope this helps anyone who might be having this problem!

  • @kirukanya
    @kirukanya 4 роки тому +16

    This is a lovely tutorial! It really helped me get started in building a LAN lobby, and saved me hours of time and headache !
    However.. I was wondering if it was possible to connect using a room name instead? Something like substituting the IP address with the room name when the lobby is created
    I am having trouble doing that and the system can only recognise the network address being changed locally, while the network address of the host is something like 'my room', in the client, it registers as 'localhost' still.. Any help would be much appreciated, I've spent so much time trying to figure this out and am unable to do much about it >

    • @mikekozlov3484
      @mikekozlov3484 4 роки тому +2

      Sure, but you need a backend solution for that. It should store map with ip_address => room_name and when user sends room name to server, it should resolve it with ip address.

    • @kirukanya
      @kirukanya 4 роки тому +2

      @@mikekozlov3484 Thank you for the reply! I've decided to use another way for network discovery but this is very useful to know!

    • @kirukanya
      @kirukanya 4 роки тому +3

      @@littledumpling5614 Hello! I used another method, so if you're looking for how to do something similar to what I wanted to using the localhost method, I'm afraid I can't help you. If you'd like to know the other method however, I'll explain a bit about it!
      So rather than have my players input the IP or localhost, I decided to use Network Discovery instead.
      Basically, NetworkDiscovery, upon starting a local host, will advertise it as a server, so all clients will be able to see it when they look for a server, and will then be able to join it!
      It's also possible to display a list of servers active, I didn't do it for my project because it isn't needed. The built-in script does make that work though, so I recommend experimenting with it.
      Here's what I used to get started: mirror-networking.com/docs/Components/NetworkDiscovery.html?q=network%20discovery
      All the best!

    • @radue9658
      @radue9658 3 роки тому

      YO thanks, but i was wondering, does this work only for local clients or can i connect to servers remotly?

    • @kirukanya
      @kirukanya 3 роки тому +1

      @@radue9658 I'm afraid I don't really know the answer to that, so you'll have to experiment and try it out yourself, all the best!

  • @denibundin6971
    @denibundin6971 4 роки тому +11

    1:00 - Coding
    5:51 - Setting Up UI & Prefabs
    11:15 - Testing

  • @leerc7721
    @leerc7721 2 роки тому +1

    I'm getting a 'no suitable method found to override' error for both the OnServerAddPlayer method and the OnServerConnect method. Any solution? thanks in advance :)

    • @koferperk
      @koferperk 2 роки тому +3

      me too, I'm also having that issue:
      [EDIT]
      Found out why and how to fix it:
      change "public override void OnServerDisconnect(NetworkConnection conn)" to "public override void OnServerConnect(NetworkConnectionToClient conn)"

  • @sharkbonebroth
    @sharkbonebroth 4 роки тому +6

    Thanks for the tutorial! One question though. In the "OnServerAddPlayer" function, why did you instantiate the roomplayerprefab instead of a player prefab. Is there a reason for this?

    • @A_Reaper23
      @A_Reaper23 3 роки тому

      same problem, do you find any solution???

    • @Osmorhum
      @Osmorhum 2 роки тому

      @@A_Reaper23 The reason is, I guess, this script is only making players join the Lobby Room and not the Game itself. Things like PV, Mana and else that we could need in game won't be usefull in lobby so we can use different prefabs.
      (I hope you did find your answer before but just in case you didn't ... ;) )

  • @Auzurialprints
    @Auzurialprints 2 роки тому +2

    When I click host the player prefab spawns which is great! Though when I go to click join with the other client I get a timeout. Using localhost and such, I am unsure where I went wrong. Been looking through all day for a solution. Hopefully I will come across something.

  • @ducttapebattleship
    @ducttapebattleship 4 роки тому +12

    THANK YOU for your tutorials. Great tuts, great channel, great tutor.

  • @matigol48-88
    @matigol48-88 4 роки тому +5

    I dont know why, but my overrides dont work

    • @augustoantenucci4725
      @augustoantenucci4725 4 роки тому

      Did you solved it?

    • @eloreneloreneloreneloreneloren
      @eloreneloreneloreneloreneloren 4 роки тому +1

      @@augustoantenucci4725 Use NetworkManager instead MonoBehaviour or something

    • @augustoantenucci4725
      @augustoantenucci4725 4 роки тому

      @@eloreneloreneloreneloreneloren thanks

    • @riskgd
      @riskgd 3 роки тому

      @@augustoantenucci4725 delete all scripts from the prefab, then go to the prefab in the scene and add the scripts

  • @kmw199614
    @kmw199614 4 роки тому +6

    When I follow your code and try running, I don't see the two objects instantiated in the Hierarchy. Is this supposed to happen?

    • @BSalabert
      @BSalabert 4 роки тому +1

      Have you found out how to solve it? Exactly the same problem xD

    • @broForseNetwork
      @broForseNetwork 4 роки тому

      @@BSalabert did you dfind out how to solve it?

    • @Frenuellcrackser33
      @Frenuellcrackser33 4 роки тому +6

      Guys I found the problem, since I had the same ^^
      using [Scene] [SerializeField] private string menuScene;
      results the string being "your current path to the assets folder + path to your scene + scene name".
      Now in the OnServerConnect method we check if the client tries to join an ongoing game, where we check if(SceneManager.GetActiveScene().name != menuScene).
      That results in checking the hole path string against just the scene name.
      So the Client gets disconnected immediately and the roomPlayer doesnt gets instantiated.
      If you fix the string menuScene, to only contain the actual scene name, it will work properly ! :D

    • @broForseNetwork
      @broForseNetwork 4 роки тому

      @@Frenuellcrackser33 i now get a error saying the object i want to instantiate is null, i've bene looking for a while but cant find a answer, would you be able to point me in the right direction? also thanks for the previous fix :) the error is with the instantiation of roomplayerprefab in Networkmanager

    • @Frenuellcrackser33
      @Frenuellcrackser33 4 роки тому

      @@broForseNetwork make sure that rhe RoomPlayer Prefab is referenced in the NetworkManager(Lobby) script in your scene. For the Player Prefab aswell as the Room Player Prefab.

  • @jonathanfrank2201
    @jonathanfrank2201 4 роки тому +4

    Hey Dapper Dino ^^
    I really appreciate these tutorials!
    I learn a lot from you and it's great.
    I've looked at the Mirror documentation because I really want to be able
    to name my lobby, your tutorial showed how to connect directly via. IP address, but if I want a server list, surely I would also want names for servers.
    Could you perhaps show how to do that?
    I've looked around the internet for days and can't find anything.
    Thank you in advance :)
    To clarify, what i mean is how to name a server when creating it, I can only find StartHost() and StartServer() where none of them takes a parameter.

    • @bestpsgamer1916
      @bestpsgamer1916 4 роки тому

      Yeah me too man I wish he do it

    • @TipTheFlip
      @TipTheFlip 4 роки тому

      Me too

    • @elektra81516
      @elektra81516 2 роки тому

      A server browser needs a dedicated matchmaking system which you'd permanently host on a separate server. Steamworks is your best bet though you can use others.

  • @mr.awesome5109
    @mr.awesome5109 3 роки тому +2

    Me: Copies code into Unity
    Unity: 8 ERRORS
    Me: 8?!

    • @TheRealKaiProton
      @TheRealKaiProton 3 роки тому

      I have that issue too, usually something small Ive missed, or just version differences,

  • @DiffyMC
    @DiffyMC 3 роки тому +1

    It doesn't connect when pressing join

  • @oldmanjim4853
    @oldmanjim4853 2 роки тому +1

    I also had the problem where the RoomPlayers weren't showing in the Hierarchy after players were joined. To fix this I had to update the OnClientConnect / OnClientDisconnect functions in NetworkManagerLobby.cs:
    public override void OnClientConnect()
    {
    base.OnClientConnect();
    OnClientConnected?.Invoke();
    }
    public override void OnClientDisconnect()
    {
    base.OnClientDisconnect();
    OnClientDisconnected?.Invoke();
    }

  • @accretiongames
    @accretiongames 2 роки тому +1

    Hey Its possible for you to make a tutorial about syncing Mirror + Fizzy + Steamwork ? I use Steamwork complete V2 with Mirror and FizzySteam , I follow your tutorial , But I don't understand how to link correctly my networkManager and my LobbyManager from Steamwork. :/

  • @jackmaxwell7342
    @jackmaxwell7342 3 роки тому +1

    this is really hard to follow, i would really prefer showing us the process of you coding each part even if it takes longer

  • @Victornemeth
    @Victornemeth 4 роки тому +2

    I did this, but my Roomplayer prefab doesn't create, but he is in the network manager as player prefab and player room prefab, what could i have done wrong? Edit: i found it for some reason my MenuScene string does not work so i needed to hardcode it like this == "Lobby"

    • @jadranzagorac6540
      @jadranzagorac6540 4 роки тому +5

      Hey there Victor, I had the same problem, i fixed it by replacing all accurances of SceneManager.GetActiveScene().name with SceneManager.GetActiveScene().path and that fixed it for me. Also that way you avoid using hardcoded strings inside code, like your "Lobby" string for example.

    • @equinnosia4976
      @equinnosia4976 4 роки тому

      @@jadranzagorac6540 thank you for this!

    • @missturbo1631
      @missturbo1631 3 роки тому

      Legend! Thank you!

    • @GingerNingerish
      @GingerNingerish 3 роки тому

      @@jadranzagorac6540 Thank fucking god for this.

  • @Charexy
    @Charexy 4 роки тому +1

    How can I make it Multiplayer out side of just the same network connection?

  • @LazyCliqueOFC
    @LazyCliqueOFC 4 роки тому +2

    A big hug from Brazil, Thanks so much

  • @gwoth5671
    @gwoth5671 3 роки тому +2

    when i enter the ip address it doesn't take me into the lobby. and it comes with the error "could not resolve the host" and then after that it would say whatever name i have put in

    • @JOHNSMITH-sj3lg
      @JOHNSMITH-sj3lg 3 роки тому

      what for ip u typed in are u on the same network on both devices?

  • @lemonjuice1336
    @lemonjuice1336 4 роки тому +1

    Spawning in the registered prefabs doesnt work for me-
    every time it throws me this message-
    Replacing existing prefab with assetId '[assetId of Prefab]'. Old prefab 'RoomPlayer', New prefab 'RoomPlayer'
    UnityEngine.Logger:Log(LogType, Object)
    Any help here? i'm really stuck on this.

    • @salpalvv
      @salpalvv 4 роки тому

      check out the solutions from @scribl1 and @Coldsandwich. it resolved this issue for me.

  • @beefbossfromwiisports
    @beefbossfromwiisports 4 роки тому +3

    Can you just join a random game instead of entering an address?

    • @0x19
      @0x19 3 роки тому

      yes

    • @sundarakrishnann8242
      @sundarakrishnann8242 3 роки тому

      @@0x19 but how do we do that?

    • @0x19
      @0x19 3 роки тому

      Idk actually still learning mirror but i did the random join thing before in a Minecraft plugin

    • @scolco1
      @scolco1 3 роки тому +1

      Search for the Mirror Component NetworkDiscovery. With that you can Broadcast your server on lan (AdvertiseServer) and also search for available Servers

  • @techinspired5628
    @techinspired5628 3 роки тому +1

    PlayerPrefs is volatile right. It's only accessible till the app cache is uncleared. When the player clears the cache then the data saved is gone right?

  • @Alex-zw7zc
    @Alex-zw7zc 3 роки тому +1

    NetworkManagerLobby.OnClientConnect(NetworkConnection)': no suitable method found to override
    NetworkManagerLobby.OnClientDisconnect(NetworkConnection)': no suitable method found to override

    • @seanlynch4354
      @seanlynch4354 3 роки тому

      Make sure you have using Mirror; at the top

    • @Marcusaralius76
      @Marcusaralius76 3 роки тому

      I am having this same issue. OnClientConnect and OnClientDisconnect aren't part of NetworkBehaviour. I wonder if this is a recent change?

    • @Marcusaralius76
      @Marcusaralius76 3 роки тому +2

      I FIXED IT! Replace NetworkBehaviour with NetworkManager

    • @jacobyiu7310
      @jacobyiu7310 3 роки тому

      @@Marcusaralius76 wow. It worked. Thank you very much

    • @tonygame278
      @tonygame278 Рік тому

      @@Marcusaralius76 not working :(

  • @rschoonackers4541
    @rschoonackers4541 4 роки тому +3

    If I chance my username when I want to connect there is no error but I can't click that confurn button so I need to play as "enter name..."

    • @keepcoding8925
      @keepcoding8925 4 роки тому +1

      Did you solved the problem? I have a same issue :(

    • @kyleweeks761
      @kyleweeks761 4 роки тому +1

      Hi, I'm also having the same button issue. I noticed that I could press it once before i put any text into the Inputfield but then once I did, every time i ran the game after that I was unable to press the confirm button. :(
      EDIT: G Chozick has a method that fixed it for me. When you on the "InputField_Name" you change the OnValueChanged from a static to dynamic.

    • @thelittlechemist941
      @thelittlechemist941 4 роки тому +1

      @@kyleweeks761 late reply but:
      put name = nameInputField.text; before the continuebutton line in SetPlayerName
      the name string is actually not linked in any way to the input field in the original code which is why it will always return true to the isnullorempty and the button will always be noninteractable

    • @equinnosia4976
      @equinnosia4976 4 роки тому

      @@thelittlechemist941 THANK YOU THANK YOU THANK YOU!!!!

  • @lucasmols8049
    @lucasmols8049 3 роки тому +2

    Is this local multiplayer only???

    • @maxmodjeski8128
      @maxmodjeski8128 3 роки тому +1

      No, It's using a networking solution called Mirror. He has another video where he shows you how to set it up, and the thumbnail is a multiplayer remake of pong. Hope this helped!

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

    any good advice if I want to use a join code to join a lobby using mirror?

  • @wizzard5574
    @wizzard5574 4 роки тому

    Client Recv: failed to connect to ip=localhost port=7777 reason=System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it.
    at System.Net.Sockets.TcpClient.Connect (System.String hostname, System.Int32 port) [0x0019d] in :0
    at Telepathy.Client.ReceiveThreadFunction (System.String ip, System.Int32 port) [0x00002] in C:\Users\Anca\Documents\AR\ar1\Assets\Mirror\Runtime\Transport\Telepathy\Client.cs:54
    UnityEngine.Debug:LogError(Object)
    Telepathy.Client:ReceiveThreadFunction(String, Int32) (at Assets/Mirror/Runtime/Transport/Telepathy/Client.cs:74)
    Telepathy.c__DisplayClass11_0:b__0() (at Assets/Mirror/Runtime/Transport/Telepathy/Client.cs:157)
    System.Threading.ThreadHelper:ThreadStart()
    Anyone knows what is this? This appears right after I click on 'Join Lobby'

    • @wizzard5574
      @wizzard5574 4 роки тому

      Actually I get this because I tried to join with my phone, the lobby I've created on my laptop... so is this not possible or what?

  • @mahdir_o406
    @mahdir_o406 4 роки тому +3

    Thank you very much for this effort👍

    • @DapperDinoCodingTutorials
      @DapperDinoCodingTutorials  4 роки тому

      No worries!

    • @rasa4207
      @rasa4207 4 роки тому

      اخي مهدي.. هل اللوبي هنا يعمل كنظام البلوتوث ؟ يعني اللاعبين القريبين من بعض فقط ؟

  • @FIXXER1001
    @FIXXER1001 4 роки тому +1

    for some reason the continue button on the external build doesn't enable when i type my name. but when i test it in unity itself it works fine. any suggestions what causes this issue?

  • @sovannoup662
    @sovannoup662 4 роки тому +1

    Your tutorial is awesome ..! I've got a question. what if i want to connect to my friend's game but i use different network connection. So what should i do?

  • @sconosciutosconosciuto2196
    @sconosciutosconosciuto2196 4 роки тому +3

    Great video

  • @tomaallary
    @tomaallary 4 роки тому +1

    The tutorial is nice, but im not finding the scripts on github.

    • @FullStackIndie
      @FullStackIndie 4 роки тому +2

      its in the mirror tutorial section of Dapper Dino's github. He didnt have seperate gits for each video, so the git you see is the completed version after following all the tutorials in this playlist

    • @whoisgliese
      @whoisgliese 3 роки тому

      @@FullStackIndie yeah but i cant seem to find the script files either

  • @radue9658
    @radue9658 3 роки тому +2

    Hey one question does this work also by remote or only for local clients? Btw those tutorials are really cool.
    Also i'm having a problem whith the input field that doesn't work: when i click on it nothing happens

    • @abhinavsrinivas2643
      @abhinavsrinivas2643 3 роки тому +2

      You have to create an event system. Top left plus icon > UI > event System

    • @radue9658
      @radue9658 3 роки тому

      Thanks, I solved it but fo you know if this works also for remote clients that connect using the IP addresses?

    • @DapperDinoCodingTutorials
      @DapperDinoCodingTutorials  3 роки тому +1

      You can either look up how to port-forward for your router or look into using stream as a relay: ua-cam.com/video/QlbBC07dqnE/v-deo.html&ab_channel=DapperDino

    • @radue9658
      @radue9658 3 роки тому

      @@DapperDinoCodingTutorials yo thanks Dapper Dino, I appreciate a lot

    • @radue9658
      @radue9658 3 роки тому

      Hey Dapper sorry if i take your time with those questions but i would like to know if you already did a video about interracting with objects or spawn objects or other similar things in a multiplayer game. Sorry again

  • @ItzRyanF00
    @ItzRyanF00 4 роки тому +1

    Can I use proton and mirror?

  • @danzrobot1425
    @danzrobot1425 4 роки тому +1

    What coding app did you use?🎁

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

    we didnt understand

  • @billyjean6516
    @billyjean6516 4 роки тому +1

    Using the code from the github created tons of namespace errors among others too, any fix?

    • @Thermality790
      @Thermality790 4 роки тому

      same problem

    • @iMinx
      @iMinx 4 роки тому

      He uses the namespaces to organize things. Don't copy the entire files over if you don't want to type the methods up yourself. Take only the class and the includes.

  • @leaven7415
    @leaven7415 4 роки тому

    what are these errors i just copied everything lol,
    1.
    Assets\Lobby Scene\Scripts\NetworkManagerLobby.cs(19,34): error CS0246: The type or namespace name 'NetworkGamePlayerLobby' could not be found (are you missing a using directive or an assembly reference?)
    2.
    Assets\Lobby Scene\Scripts\NetworkManagerLobby.cs(27,21): error CS0246: The type or namespace name 'NetworkGamePlayerLobby' could not be found (are you missing a using directive or an assembly reference?)
    edit: I cant Also find Network Identity and all scripts i have them but i cant drag them to RoomPlayer???

  • @raghav2356
    @raghav2356 Рік тому

    how to list the host

  • @spiidermonkeyy3568
    @spiidermonkeyy3568 2 роки тому

    i'm getting an error in the networkmanagerlobby script saying that the name 'ClientLobby' does not exist in the current context. How could i fix this?

  • @reaperrg93
    @reaperrg93 4 роки тому +1

    It is spelled "eelyA gavrEElov" Dapper Dino san)) Upper cases are the stress letters

  • @shortiez3149
    @shortiez3149 4 роки тому +5

    Great video, been needing to do this for my own game

  • @bharat2277
    @bharat2277 Рік тому

    Hi, iam facing collision detecting issue with raycast in addtitive scene in multiplayer game. player not able to detect other objects in additive scene but on mainscene it works.Can anyone help me with this fix?

  • @jasgarsoul
    @jasgarsoul 3 роки тому

    I really hope I didn't miss anything, but for some reason it doesn't allow me to click in the Input Field in the first place. Does anyone know what could be the problem??

  • @gangelo24
    @gangelo24 4 роки тому +2

    Nice video, cant wait for the others

  • @NotPalliot
    @NotPalliot 2 роки тому

    Im pretty sure its not supposed to happen, but when I test it out, it crashes the game. Im not sure where I went wrong, becuase it doesn't really give a reason why

  • @fv4202x
    @fv4202x 2 роки тому +1

    Tags for ctrl+f users: "Cant" "Connect" "Join" "Instantiate" "Room" "Player" "Prefab"
    SOLUTION FOR CANT CONNECT WITH JOIN BUTTON
    I dont know why but as its like that in NetworkManager, StartClient() function should be above of "networkAdress = ipAdress" line.
    This fixed my problem that "Join button wasnt working."
    So shortly replace JoinLobby with this:
    public void JoinLobby()
    {
    string ipAdress = ipAdressInputFieldText.text;
    networkManager.StartClient();
    networkManager.networkAddress = ipAdress;
    }

  • @alessiodipretoro38
    @alessiodipretoro38 2 роки тому

    hi, i have a strange issue, when client join i can see in server the new prefab, but it's created over the prefab of the server, so on the server i can't press any button couse they'r covered by the client prefab. any ideo to fix it?

  • @newar5783
    @newar5783 3 роки тому +1

    Not even a tutorial, you are just telling us what everything does, and showing us what we could do.

    • @Jordofentdealer
      @Jordofentdealer 3 роки тому +1

      Yea I know I don't even know where to start XD

    • @Jordofentdealer
      @Jordofentdealer 3 роки тому

      Yea I don't know where to start XD

    • @JOHNSMITH-sj3lg
      @JOHNSMITH-sj3lg 3 роки тому

      this is the point of a tutorial show and explain

  • @vinh-toanphan492
    @vinh-toanphan492 3 роки тому

    Room player prefab doesn't spaw when hosting and joining, any idea on how to fix this ?

  • @GarronArgentina
    @GarronArgentina 3 роки тому

    Why do you say landing page to a couple of buttons? XD

  • @flarra
    @flarra 3 роки тому

    10:08 just Ford me. Nothing special

  • @JOHNSMITH-sj3lg
    @JOHNSMITH-sj3lg 3 роки тому

    the continueButton dosent get interactable after type in username what should i do?

  • @paultal
    @paultal 4 роки тому +1

    Thanks! Also I like the fact that you have LoL opened in background.

  • @raymondlin642
    @raymondlin642 3 роки тому

    Is there a reason why OnStartClient has to foreach the same prefabs folder that OnStartServer can just put in spawnablePrefabs? Its the same method right?

  • @rubycart123
    @rubycart123 3 роки тому

    please help it always says cannot resolve host

  • @MissMoonlightStreak
    @MissMoonlightStreak 4 роки тому +5

    Amazing video, clear and concise explanations at every step. Really helped break down the process of setting up a lobby, which I've been too daunted by before now to get any further than the first couple of files on my own! Thank you so much :)))))

  • @Sillymonkeies
    @Sillymonkeies 3 роки тому

    This doesnt work for me :/

  • @Gabber1110
    @Gabber1110 3 роки тому

    I have a question, suppose i have different network managers for different scenes and i set DontDestroyOnLoad to false, how does it work with scene change ? does it work just like that or do you have to do something to make it work ?

  • @aw1lt
    @aw1lt 4 роки тому

    FINALLY ONE THAT ISNT FROM 69 YEARS AGO HOLY SHIT

  • @WelshGuitarDude
    @WelshGuitarDude 3 роки тому

    How do you list existing lobbies to choose from rather than just inputting the lobby name? Where is that info hosted to?

  • @GarronArgentina
    @GarronArgentina 3 роки тому

    This video has to be place before

  • @Hairclone
    @Hairclone 3 роки тому +1

    As soon as my client connects I get this warning: KCP: received unreliable message in state Connected. Disconnecting the connection. Any ideas? I'm using ParrelSync rather than building the game.

    • @nasostsionas
      @nasostsionas 3 роки тому

      did you found anything on this?

    • @Hairclone
      @Hairclone 3 роки тому

      @@nasostsionas Unfortunatly, no. I tried changing from kcp transport to telepathy transport on the networkmanager object (as Dapper has in his video). Now I instead get the following message when the client joins the server:
      ReceiveLoop: finished receive function for connectionId=1 reason: System.ObjectDisposedException: Cannot access a disposed object.
      Object name: 'System.Net.Sockets.NetworkStream'.

    • @Hairclone
      @Hairclone 3 роки тому +1

      Yea, there is definatly something wrong with the custom network manager. There are no issues to connect when using the default network managers. I'm trying another tutorial to see if that works better

    • @nasostsionas
      @nasostsionas 3 роки тому

      @@Hairclone Yeah I agree with you because me too I have no problem connect with the default network manager (even through internet) but with the custom network manager I always get that damn error :'(

    • @Hairclone
      @Hairclone 3 роки тому +2

      @@nasostsionas The error is in the OnServerConnect method. For me it somehow always thinks that the menu scene is NOT active and disconnects. Try reconnecting the client once more after the error or comment out that part of code and see if it works out for you.

  • @Steve-gi2yj
    @Steve-gi2yj 3 роки тому

    thank you for the tutorial, so far, I have the host game or start game running, but for some reason, my other app that is on my unity studio, i run it, and try to click join, doesnt go... it just disconnects or times out... i run it to connect local host and made sure my firewall is turned off... I tried the network manager actual mirror... and it runs fine... any ideas? anything i can paste or send you that could help figure this out?

  • @evsucksatcode2726
    @evsucksatcode2726 3 роки тому

    How would I find a random match? Im making a game where you verse other people, but I dont want to use IP address

  • @techinspired5628
    @techinspired5628 3 роки тому

    How to auto start, so that player can join if there are any matches having some vacancy else can host a game. Please reply. Thank you in advance 👍

  • @nicholasandersen6138
    @nicholasandersen6138 4 роки тому

    Currently both of the lobby UI's spawn on the host's client. I tried moving everything from OnServerAddPlayer to OnClientConnect, which fixed that problem but then the OnStartClient on the spawned object would not be called. If anyone has a fix lemme know

  • @elmonsieur9905
    @elmonsieur9905 4 роки тому +1

    fisrt , thank you so much for this tuto , then i don't know why when i see Get and Set i really dont know how it works , i'm confused each time i see get and set , even though i have knowledge about programming in c#

    • @DapperDinoCodingTutorials
      @DapperDinoCodingTutorials  4 роки тому +3

      It's about getting and setting the variable. If it's a { get; private set; } it means that the variable can be read from other classes but only set privately (in the class with the variable)

    • @elmonsieur9905
      @elmonsieur9905 4 роки тому

      @@DapperDinoCodingTutorials ohh i undestand better now , thank you so much

  • @Steve-gi2yj
    @Steve-gi2yj 3 роки тому

    For some reason, when I start host, its fine, the secondary client, is able to connect, BUT when I look at host, I don't see RoomPlayer(Clone) prefabs being created for the one hosting and the other joining... i checked... I am pretty close to exactly what is on the tutorial... BUT like couple of things people in the comments pointed out, some minor issues and fixes... anyone else come across this issue?

    • @Steve-gi2yj
      @Steve-gi2yj 3 роки тому

      @@ThePro-ng4yt Cool thanks, your right, I used the Network manager, and it works, the client shows up, not sure why the RoomPlayer(clone) doesn't show up when using the NetworkManagerLobby :(

  • @aljoharahbintamran6580
    @aljoharahbintamran6580 3 роки тому

    How to create lobby using javaScript ? Also How to display a random code where other player can use to join the lobby ?

  • @gowthamrajarathinam1148
    @gowthamrajarathinam1148 4 роки тому

    I am not able to add the room player prefab as the player prefab in the network manager lobby. I get the error that player prefab must have NetworkIdentity. My room player does have the network identity component. And I have applied the changes to the the prefab as well. It still won't let add it to the network manager. Please help me.

    • @gowthamrajarathinam1148
      @gowthamrajarathinam1148 4 роки тому

      Ok if anyone has this problem, the issue is you might have added the standard network identity, and not the one from Mirror. After fixing this, it should work.

  • @player315xbox
    @player315xbox 3 роки тому

    i need to make the network mannager if im using mirror?

  • @cool-lm4cf
    @cool-lm4cf 3 роки тому

    when i click on host lobby i get this error message "NullReferenceException: Object reference not set to an instance of an object"

    • @dfgesfg
      @dfgesfg 3 роки тому

      There is one object that is Not assinged top the script i think(sorry my Englisch is Not so good)

  • @duff8027
    @duff8027 Рік тому

    Thanks a lot for doing this

  • @kravataf
    @kravataf 2 роки тому

    Thanks bro

  • @hansiindgame1375
    @hansiindgame1375 4 роки тому +1

    Can You make os to Download You game ??? Plz.

  • @hollowdevelopment1
    @hollowdevelopment1 2 роки тому

    Hello, I love your tutorials Dapper, thank you so much! Also is there a way to generate a join code rather than using an IP address and if so will you add it in a tutorial or github (not a request just a question)?