How to Build a Multiplayer Game with Unity + Mirror

Поделиться
HTML-код
  • Опубликовано: 19 июн 2024
  • GitHub: github.com/ShrineGames/UnityM...
    In this video, we'll set up everything we need to build a multiplayer game in Unity using Mirror.
    Introduction: 00:00
    Why Mirror: 01:20
    Setting up Unity project: 03:00
    Setting up ParrelSync: 04:54
    Pong Example: 07:20
    VSCode: 09:50
    Git: 10:40
    Multiplayer Demo: 14:26
    Outro: 25:40

Комментарии • 250

  • @murkorus7147
    @murkorus7147 6 месяцев назад +6

    If you're using this tutorial around the time of this comment, you maybe got an error similar to me:
    6 errors when trying to hit play at 21:14 in the video. Something about a transport not being assigned.
    In the video, the Network Manager component automatically adds another component to the object and finds it, but it didn't do it in my version of unity and mirror (and maybe not in yours too). To fix this, go to your NetworkManager gameObject, in the inspector, click "Add Component", then search for "Telepathy Transport (Script)", and add it. In the Network Manager component on the same object you just added the Telepathy Transport component to, look for a setting called "Transport" (Probably around half-way down), drag and drop the Telepathy Transport (Script) component to that setting, and you should be good to go. :)

  • @derekrocco4344
    @derekrocco4344 Год назад

    Amazing tutorial! Thanks for setting this up! Love seeing insights into others' dev envs alongside explanations of how these systems work - ParrelSync is a great inclusion here!

  • @gamesinajar7577
    @gamesinajar7577 3 года назад +5

    Been waiting years for a good multiplayer tutorial in unity! This is perfect, thank you so much!

  • @Limofeus
    @Limofeus 3 года назад +9

    Gorgeous tutorial! I was struggling to make at least something with multiplayer and also had to waste a lot of time compiling the project, this video helped me to fix all of my issues! Great guide!

  • @FlorisChan
    @FlorisChan 3 года назад +3

    I can't explain how happy I am that I found your tutorials. I am genuinely emotional because of the quality of this tutorial. Thanks so much!!

  • @Tongyo42
    @Tongyo42 3 года назад +11

    I was watching a couple tutorials on mirror and I figured i got the basics but i was struggling a lot on this first step. This Hello World approach helps wonders. Thanks dude!

  • @chatbear69
    @chatbear69 3 года назад +1

    Thank you for this series of videos on networking. I have learned more by watching 2 of your videos than I have learned in the past year. You are the man and please keep up the good work.

  • @devyncurley6311
    @devyncurley6311 3 года назад +14

    So well done! Thank you for putting in the effort for this, especially sharing how you use Parel Sync, and your set up on Visual Code.

    • @ShrineApp
      @ShrineApp  3 года назад +1

      Glad it was helpful!

  • @pierrelamusse8350
    @pierrelamusse8350 3 года назад +1

    Great intro !
    It has been 2 days that I am trying to find up to date and interesting tutorials on mirror.
    I think we have a winner !

  • @AviatorXD
    @AviatorXD 3 года назад +109

    Finally someone making a good multiplayer tutorial for Unity! Thanks alot man!

  • @sebasVarela
    @sebasVarela 3 года назад +2

    This is needed, a good multiplayer game tutorial in unity, your video is already in my favorites. thanks

  • @WilliamClavier
    @WilliamClavier 3 года назад +12

    I wasn't expecting this series to be so new, I thought it was another tutorial from like a year or two ago

  • @Devir666
    @Devir666 3 года назад

    duuuude. awesome. I think you refreshed the tutorials of mirror, you picked up a better way for conducting the network idea, and all the preparation with github, parrelsync and asset store is fast and well done. (the git part is very begginer-friendly)
    I gonna see it all. thanks!

  • @frederickfreund1957
    @frederickfreund1957 2 года назад

    Thx a lot for that video! Very good quality and very helpful. I also like, that you introduce all the tools in this video. For my part I didnt hear of ParrelSync before and it seems to be super useful!

  • @Ayyouboss
    @Ayyouboss 3 года назад +15

    Your channel is just way too underrated. Great work!

    • @tamla9875
      @tamla9875 2 года назад

      Cuz his logo looks like shit

  • @GingerNingerish
    @GingerNingerish 3 года назад

    This tutorial is so well structured and clearly explained.

  • @RogueWorlds
    @RogueWorlds 3 года назад +82

    I'm glad you picked Mirror, there are already way too many photon tutorials

    • @ShrineApp
      @ShrineApp  3 года назад +26

      Agreed! And Mirror is definitely the way to go imo

    • @rikrishshrestha5421
      @rikrishshrestha5421 3 года назад +5

      Totally agreed, it's hard to find good mirror tutorial.

    • @tal5008
      @tal5008 3 года назад +2

      @@rikrishshrestha5421 but not for me lol

    • @rikrishshrestha5421
      @rikrishshrestha5421 3 года назад +3

      @@tal5008 you mean to say you've found some good mirror tutorial, any recommendations?

    • @ItsCodeRedYT
      @ItsCodeRedYT 3 года назад +1

      @@rikrishshrestha5421 dapper dino is pretty good

  • @hasi-bhasan3448
    @hasi-bhasan3448 3 года назад

    I hope this series gets continued, there are so many videos, that just keeps doing stuff, more like copy paste. But this video is amazing! Kudos!

  • @randyh3761
    @randyh3761 3 года назад

    Excellent! Was a huge help and great jump-start to a bare-bones multiplayer setup

  • @madamutzsar
    @madamutzsar 3 года назад +2

    great video, you're doing a fine job explaining things. I'm going to watch the rest of what you've uploaded and I look forward to more! :D

  • @spanishwithtyler
    @spanishwithtyler 2 года назад

    So, so helpful! I am just beginning to learn how Mirror works, and this video was perfect!

  • @witch-doctor
    @witch-doctor 3 года назад

    Many thanks! I'm amazed at how fast I got this multiplayer thing working thanks to you!

  • @adelinebrow3557
    @adelinebrow3557 3 года назад +2

    Great tutorial! Please make sure to continue the series to the end 👍

  • @Cellfan
    @Cellfan 3 года назад +4

    Thank you very much for the work you have put into all of this!
    Its amazing, good pace! Please keep it up :)

  • @sushiwaumai4773
    @sushiwaumai4773 3 года назад +6

    This tutorial is way better than the networking tutorial from Tom Weiland. You can actually understand the stuff. Great job!

  • @motorparadise
    @motorparadise 2 года назад

    I searched for Unity Multiplayer Mirror and Got Git in Bonus. Great Work. Great Explanation.

  • @cloudlessrainvisions3264
    @cloudlessrainvisions3264 3 года назад +1

    This is my favorite Mirror intro video! I think this should be added to the Mirror documentation!

  • @Kusaji
    @Kusaji 2 года назад

    Great first video, will be watching the rest of the series. Thank you.

  • @rodgermccallister1606
    @rodgermccallister1606 Год назад +1

    Absolutely fantastic! Exactly the guide I needed to get started :)

  • @jdonaldsontcs
    @jdonaldsontcs 3 года назад +15

    I wish you the best of luck with this series! Do yourself a favor and write out a roadmap so that you can keep yourself on track. The scope you laid out in this video is large but man is it needed! I look forward to watching it!

    • @ShrineApp
      @ShrineApp  3 года назад +2

      Yep I have a rough roadmap in my head but I'll def keep that in mind. thanks for the kind words :)

  • @tuvbuv4491
    @tuvbuv4491 3 года назад

    I have been trying for the past 10hr to figure out Mirror and This is the only good multiplayer tutorial i have found yet

  • @zack4383
    @zack4383 3 года назад

    the other tutorial i watched sounded like a foreign language 15 minutes in, I understood this fully throughout the entire half hour. thank you.

  • @meytristeed1525
    @meytristeed1525 3 года назад +2

    Can't wait for the next part!

  • @tsumurireallll
    @tsumurireallll 2 года назад

    Great tutorial. I've never seen anybody credit Linus Torvalds when explaining Git before, and it was nice to see.

  • @rus89
    @rus89 2 года назад

    Amazing tutorial.
    Thanks for the time and effort you put into this.

  • @minkworks6143
    @minkworks6143 Год назад

    Very high quality tutorial. Thanks for this.

  • @rustyrishii
    @rustyrishii 2 года назад

    Holy shit man... it's really hard to believe that an amazing tool like ParrelSync is free. Absolute mad respect to whoever created that.

  • @GregDunn
    @GregDunn 2 года назад +2

    If anyone is following along and getting an error about NetworkBehavior not being found... note that Mirror uses the British spelling and that's there's a u in there -- NetworkBehaviour

  • @tibiasurvival4307
    @tibiasurvival4307 3 года назад

    Straight to the point, nice tuto!

  • @user-kk1be7tu4g
    @user-kk1be7tu4g 3 года назад

    Very good tutorial. I benefit a lot as a junior game developer. Thanks!

  • @caiowcosta
    @caiowcosta 3 года назад +11

    Amazing tutorial, thank you! For those who are experiencing VSCode problems not finding the "Network Behavior" class and the "Mirror" namespace, go to the C# extension you installed and downgrade your version to 1.23.2, clicking on the gear and "installing another version..." and typing "1.23.2", for me it worked

    • @ImMrBigBigMac
      @ImMrBigBigMac 3 года назад +1

      tyty! was losing my mind over this one.

    • @sh0ckwav3_
      @sh0ckwav3_ 3 года назад +1

      Thank you so much.

  • @marshall2439
    @marshall2439 3 года назад

    It was perfect tutorial for me
    all the error fixing and stuff
    perfect !
    really liked it

  • @ArranAsh
    @ArranAsh 3 года назад

    Thanks a lot, really helpful guide on getting started

  • @kamleshk267
    @kamleshk267 3 года назад +3

    Oh god! This is the best finally...

  • @SatyamKumarGuptaBME
    @SatyamKumarGuptaBME 11 месяцев назад

    This was really helpful, thank you so much, for such a nice tutorial

  • @timoteo_cruz
    @timoteo_cruz 3 года назад +2

    New sub here. i was looking for that! I cant watch now but i will soon!!!! Keep going man.

  • @sakul_the_one4821
    @sakul_the_one4821 2 года назад

    Thx for this epic Totorial, it helped really!

  • @washburnlane
    @washburnlane 3 года назад

    Outstanding, thank you!

  • @sininenhaitari6650
    @sininenhaitari6650 3 года назад

    Really good looking stuff! Keep it up!

  • @Epic3dPro
    @Epic3dPro 3 года назад

    Awesome, thanks for the tutorial

  • @jackbrown9791
    @jackbrown9791 3 года назад

    Looking forward to the next one 😁😁😃

  • @ColorfullHD
    @ColorfullHD 3 года назад

    Great tutorial, thanks!

  • @AlexanderZotov
    @AlexanderZotov 3 года назад

    This is just perfect!

  • @Ivcifer
    @Ivcifer 3 года назад

    you are a gentleman and a scholar.

  • @dil.e_musafir
    @dil.e_musafir 2 года назад

    Awesome Tutorial!!!!!🔥🔥🔥🔥

  • @NelsonSKA
    @NelsonSKA 2 года назад

    Great Tutorial!!!

  • @sumitcutevil9260
    @sumitcutevil9260 3 года назад

    tysm m gettting started helps a lot

  • @ShinichiKudoQatnip
    @ShinichiKudoQatnip 3 года назад

    Subscribed and so thankful 🤗❤️
    I seriously want to get rid of my reliance on photon

  • @dan-mechanics2014
    @dan-mechanics2014 3 года назад

    Amazing tutorials

  • @vimukthikulasekara2109
    @vimukthikulasekara2109 2 года назад

    thanks man this video is awsome this helps me a lot...............

  • @MaGiStReall
    @MaGiStReall 3 года назад

    Amazing! Keep it up

  • @aleksandarglisic1794
    @aleksandarglisic1794 3 года назад

    Perfect Tutorial :)

  • @3mrxD
    @3mrxD 3 года назад

    thanks for the content!

  • @jaumeivars
    @jaumeivars 2 года назад

    Mirror added your tutorials to its documentation tutorials!

  • @marcusferron
    @marcusferron 3 года назад

    Very Good tutorial!!!

  • @xGAMER-xc4tm
    @xGAMER-xc4tm 3 года назад

    im rly a beginner in this but with this tutorial i think i could make my dream game

  • @kesselokingakoumou8063
    @kesselokingakoumou8063 9 месяцев назад

    Thank you so much.

  • @masoli2321
    @masoli2321 3 года назад

    thx for the vid helped a lot

  • @onefoxstudio
    @onefoxstudio 3 года назад

    That is fuuuucking awesome ! ParrelSyncwoooooooooo

  • @blushingbutterfly7742
    @blushingbutterfly7742 3 года назад

    thank you so much!

  • @techinspired5628
    @techinspired5628 3 года назад

    Bro I am waiting for your new videos on this topic. Please upload it as soon as possible. It's my humble request 😁 Thank you 👍

  • @ayan3789
    @ayan3789 3 года назад +1

    it's a really good tutorial! show him some love by subscribing! great job!

  • @fahmibaguswibowo2058
    @fahmibaguswibowo2058 3 года назад

    thanks man !!!

  • @morybest
    @morybest Год назад

    very good

  • @unkillablespirits8582
    @unkillablespirits8582 Год назад

    Im following this tutorial to the end , just wanna say , when i made the clone i had to open the scene in the original editor it wasnt just automatically open like yours but it connected

  • @aleksey8405
    @aleksey8405 3 года назад

    Great!

  • @zukarimoto_q
    @zukarimoto_q 2 года назад

    Thank you for this tutorial series! I am trying to implement your workflow into an existing single player project with a first person controller I got from the asset store (movement + cameraLook). Can I simply change the existing scripts from MonoBehaviour to NetworkBehaviour, and add the 'if (isLocalPlayer)' statement before everything that handles my existing functions?

  • @ShrineApp
    @ShrineApp  3 года назад +39

    Hope you enjoyed the first tutorial! You can join our Discord here: discord.shrine.app

    • @caspronauta
      @caspronauta 3 года назад

      Although I found the first video a little off-topic with all the networking background, I really enjoyed this one.
      Would you explain in detail the lag that can be seen? It seems a little excessive to me, but it could be due to debuggers or other Whatnots. I would appreciate more on this on future videos.
      Can not wait to see the next one!

    • @ShrineApp
      @ShrineApp  3 года назад

      @@caspronauta Glad to hear :) The actual network delay/lag in this is as minimal as it gets (since I'm running both clients on the same machine). There is some slight visual delay because I have 2 editor windows open + recording at 60fps

    • @sayvillegames
      @sayvillegames 3 года назад

      Great JOB

    • @sergius.of.nothing
      @sergius.of.nothing 3 года назад +1

      the ckecking of Client Authority checkbox on NetworkTransform was so fast, I completely missed it. So if anybody has issue with synching just check that that checkbox checked aha

  • @kioka2
    @kioka2 3 года назад

    Nice video man!! Good material to learn! One question... why a prefab must have only one NetworkIdentity?

  • @brainshack9077
    @brainshack9077 2 года назад

    Dots is like Fusion energy, always at least a year away :D

  • @magicpixeltree
    @magicpixeltree 3 года назад

    Awesome

  • @mickmickymick6927
    @mickmickymick6927 3 года назад

    May I suggest adding the playlist URL to the description, it's easier than having to go search for it each time.

  • @duwangchew
    @duwangchew 3 года назад

    Great video, now I don't have to fail at university and finally get a degree.

  • @dshreenath360
    @dshreenath360 3 года назад +2

    is it possible to make a host migration for mirror and that to without any time delay ? Please answer me. thank you

  • @mooooooon9296
    @mooooooon9296 3 года назад

    Good job bro (Y)

  • @leandrocruz6621
    @leandrocruz6621 3 года назад

    Muito obrigado, excelente

  • @kevinp2540
    @kevinp2540 2 года назад

    Nice video! Do you think now it's better to start a multiplayer project with Mirror or use MLAPI (which is now owned by Unity)?

  • @sqw33k
    @sqw33k 2 года назад

    Thanks for the tip about ParrelSync! I have a slight problem with it though and it is that the execution of either non selected copy of Unity seems to "fall behind".
    As in, the (selected) one is sending data in FixedUpdate but the server isn't handling it at the same rate in it's FixedUpdate. If I switch it catches up and now consumes data faster than the other is sending.
    I believe this to be related to windows not giving enough resources to handle both applications at equal priority but I am not sure and welcome any ideas on how to fix this. :)

  • @sandudianaelena1013
    @sandudianaelena1013 3 года назад +1

    Hi! I watched the multiplayer tutorial and I have a question. I have two players. One of them jumps. In the second player's window, the first player is shaking when he's trying to jump. But if both of them are walking,, everything looks smooth in both windows. Do you have any ideas?

  • @Therealslimfranky
    @Therealslimfranky 3 года назад

    Very nice tutorial, thanks! What is this mouse? It clicks like a mechanical keyboard switch :-)

  • @amandalinn3618
    @amandalinn3618 Год назад

    Amazing tutorial and I love ParrelSync! I remember you having other videos but they disappeared. do you know where they went?

  • @Jok55r
    @Jok55r 2 года назад

    thank u

  • @dasjustinn
    @dasjustinn 3 года назад +1

    Cool

  • @halo3forge
    @halo3forge 3 года назад

    Great video, you explained everything very well. Quick question: If we are creating a game with 100 player functionality should we use PlayFab or self host with Easy-Wi or Pterodactyl? In terms or scalability I am thinking FlayFab makes more sense, that way we can focus on game development and not maintaining servers. What do you you think is the best route? We want an option that is scalable.

    • @ShrineApp
      @ShrineApp  3 года назад

      I would use PlayFab or GameLift

  •  3 года назад

    Loved this tutorial, but I was wondering how to use mirror to create a multiplayer project with Unity webgl... any advice?

  • @piztech5168
    @piztech5168 3 года назад +1

    Is it okay if I don't set up Git and backup my documents in Github? If so, is it really necessary and will be used later on other tutorials? I just really prefer not to do it, I'm just trying to learn and it's already too complex for me
    Edit: Yeah nvm, I actually don't have to do it which is good for me. Also, great tuts man, clear explanation and very beginner friendly

  • @saturnjr9136
    @saturnjr9136 3 года назад

    So how would I parent a camera to the player so its first person? Does the camera also need a networkidentity?

  • @nonstapp6558
    @nonstapp6558 3 года назад

    Hello, great tutorial. I wonder if it works just on devices connected to the same network, or maybe it can work on different networks? Thanks for the reply

    • @ShrineApp
      @ShrineApp  3 года назад +1

      Can work across the entire Internet :)

  • @kiisshen244
    @kiisshen244 3 года назад

    Will this work if I play with my friends? They just connect to my ip addres? Will I need port fowarding etc?

  • @RugbugRedfern
    @RugbugRedfern 3 года назад +12

    Are you ever going to cover steam implementation? Lobbies/friends/dedicated server hosting?

    • @ShrineApp
      @ShrineApp  3 года назад +17

      Yep I will have vids about integrating with Steam for friends list, leaderboards, and matchmaking/lobbies. As for dedicated hosting, I'll cover a few different cloud providers

    • @RugbugRedfern
      @RugbugRedfern 3 года назад +2

      @@ShrineApp Very cool! Looking forward to this series. There aren't any covering steam and mirror in-depth at the moment, and it's been a little difficult to figure out.

    • @mikelanimations138
      @mikelanimations138 2 года назад

      your game is good. I didn't expect to see you here.

    • @RugbugRedfern
      @RugbugRedfern 2 года назад +1

      @@mikelanimations138 thanks dude :)