How To Make A Multiplayer Game In Unity - Ownership & Authority

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

КОМЕНТАРІ • 297

  • @Jordofentdealer
    @Jordofentdealer 4 роки тому +186

    Make sure to put at the top using Mirror;

    • @maxacan8532
      @maxacan8532 4 роки тому +17

      thanks :D. i was trying to get the "NetworkBehaviour" working but couldn't figure out why it was not working

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

      @@maxacan8532 I don't understand why he did not tell us that. Btw all the coding is unnecessary. All you have to do is just put your player in the network manager. It saves a lot of time.

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

      Thanks Man! you saved my alot of time. :)

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

      @@Jordofentdealer right, this is the most important thing for the script and he didn't tell in the video. Maybe he forgot.

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

      so, when im putting it at the top, it doesn't shown up and "using mirror" doesnt work

  • @eldowado1381
    @eldowado1381 4 роки тому +84

    When using *networkbehaviour* you will need to add "using Mirror;" at the top of the script, for example, directly below "using UnityEngine;"

    • @TheFede98
      @TheFede98 3 роки тому +8

      u saved my life

    • @greenstone1489
      @greenstone1489 3 роки тому +10

      OMG I HAVE WATCHED THE VIDEO 50 TIMES NOW TO FIND OUT WHAT'S IN THE FIRST LINE I STARTED ANALYZING THE VIDEO 6:00 PM AND NOW IT'S 10:48 PM THANK YOU SO THANK YOU !!!!

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

      you're a saviour

  • @Throzen
    @Throzen 4 роки тому +9

    Great Video! I switched to mirror a while back at work when we needed a replacement for the traditional UNet and I just then found out about it, and I'm glad to see it get some love :)
    Keep up the great work.

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

      same here
      however there are not alot of tutorial about mirror :(

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

      @@alipk2633 thats true, although pretty much all info /tutorials on UNet apply to Mirror as well. And the Discord is a good source as well, I would recommend that too

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

    this series is so helpful. I love it, u really deserve more subs

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

    You should make more mirror videos theyre really helpful :)

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

    make sure to put Using Mirror; just below where it says Using UnityEngine or your script wont work at all

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

    Nice tutorials man! I'm really looking forward for a tutorial on server authoritive movement and dedicated server, It will be really cool! Thanks for the good content!

  • @EnderElohim
    @EnderElohim 4 роки тому +13

    what is the different of [Server] and [ServerCallback]
    Also what is the difference of hasAuthority and isLocalPlayer

    • @Change-jy1rl
      @Change-jy1rl 3 роки тому +2

      when you mark a function with [Server] if anything tried to call it you'll receive a error message
      that's why the [ServerCallbacl] exists its basically the same as [Server,] but with no error, so you can use it on stuff you have no control over not getting it called like a update())
      the main difference between hasAuthority and isLocalPlayer is that the server by default has authority over all objects so hasAuthority will return true in the host even though the object is not the local player
      so if you tried to move with has authority the player that is hosting the game will move all players when he moves because he has hasAuthority

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

      @@Change-jy1rl So if i create a object in scene and in it's script if i use hasAuthority that mean only host gonna interact with it right? Cool, with it i would know only host is interacting with it

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

    behavior vs behaviour ....people separated by the same language :D
    Great work here, thanks!

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

    Very good tutorials, explanation 1000 and understanding and cover many things

  • @mikael9931
    @mikael9931 4 роки тому +13

    When i tried to change from monobehaviour to networkbehaviour it doesn't show up. Anyone got a fix for this?
    Edit: Nvm just put using Mirror; to the top.

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

    Very detailed in describing how this how thing works. THanks

  • @Sir.Rollback
    @Sir.Rollback 4 роки тому +1

    This is a really clear tutorial, Thanks!

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

    After i use "Command" and "ClientRpc", the host and the client dosn t sync anymore and if i try to move one player then all the players in that window start to move without sync with the other windows. Any solution?

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

    Problem "The name 'hasAuthority' does not exist in the current context" is update to => hasAuthority = isOwned

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

    0:12 "and stole it ,aaaaa, sorry open in Unity" XD

  • @ivanpolkanov3273
    @ivanpolkanov3273 4 роки тому +21

    Yeah bro is is brilliant like always!!

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

    Very well explained!!

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

    I tried export to android and i have one bug "A connection cannot be established as the target computer expressly denied that connection."

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

    Ok for some reason everything was working but only if i was the server and the client. When using the program only as a client it was not showing the updated position on the server, but only on the client itself. What i did to fix that was to change the "network manager" with the "authority network manager script", and now everything is working. I think it has something to do with the "network transform" component, not having the checkbox for the client authority anymore.

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

    Awesome! Just what I hoped for

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

    I love it!
    Thank you for this amazing tutorial!

  • @glenzhang3646
    @glenzhang3646 4 роки тому +9

    Great video, are there easier ways to test multiplayer other than build and run every time? It is becoming slower when the project grows larger, sadly Uecho does not work anymore and I did not find an alternative

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

      You can use UnityProjectCloner from hwaet on github. It's the as Uecho. I really recommend it instead of building your project each time

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

      @@goldytack I'll try it out, thanks a lot!

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

    Why does the networktransform component not sync anything AT ALL for me? I don't understand what I'm doing wrong...

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

    personally i use parents object to separate an categorize my project

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

    Ok now I followed the tut as exactly as I could, but when I disable NetworkTransform, my player doesn't sync with the server anymore

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

    fuck this series is so good man, thanks for your time

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

    Thanks for your video, great explanations, great rythm

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

    Nice video! Is there a video of you where you show how to check the player authority on the server? Would be super helpful.

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

    If i understood correctly when we use CmdMove() with the command tag we're basically setting the method to work on the server. Then inside the server method we call the RpcMove which is a Client method since there's [ClientRpc]. Then what happens is On the update method if we're the owner of the gameobject, and if we're pressing space, we call the CmdMove() method which has the RpcMove() method inside it, which is eventually gonna move our gameobject in your client. My question is, where are we syncing the movement between the client and the server?

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

      Answer to my question should be: When a client presses "spacebar" it executes the CmdMove() and then broadcasts RpcMove() to all clients. However only the gameobject owned by the client that pressed the space bar will execute rpcmove and perform the movement. This ensure that the movement is synchronized across all clients, but only affects the gameobject owned by the initiating client

  • @xGAMER-xc4tm
    @xGAMER-xc4tm 3 роки тому +1

    plz can somebody help me i got stuck unity tells me that !hasAuthority isnt known

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

    So I have a self balancing ragdoll setup with player controlls, so I I want to sync the ragdoll joints and the parts and stuff, do I need to add the network transform and the network identity component to every single child in the player hierarchy?

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

    The Telepathy Transport uses TCP. Isn't UDP better suited to face paced games like shooters?

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

    Thank you very much for this effort👍

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

    Thanks for this amazing tutorial bruh

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

    how did you do the server stuff did you created it alone or you bought a amazon cloud server or google cloud server?

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

    whenever i connect a client, the host and client use that new player?How do i keep the host using the original player?

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

      If each player prefab has it's own camera, you need to write a script that disables it if it's not the localPlayer.

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

    I'm thinking of creating a multiplayer fps for LAN hosting - mirror or photon?

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

      Just for LAN? Regardless, I'd say Mirror since you don't have to pay and it's a lot simpler in my opinion

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

      @@DapperDinoCodingTutorials Ah okay, will you be covering how to set everything up and implement it into games?

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

    There is a bug that if I move one sphere (client A) to the point that it will touch second sphere (client B) then I can move second sphere (client B), not the original one. So client A moves client B instead of his sphere. I've reproduced the same issue after downloading your project from github on my PC. It is about the version of Mirror?

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

      Nah i didn't Found Such Bug i even tried to recreate the scenario u are talking about but i was not able to remake that one so i am pretty sure u did something wrong

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

    Why can't you just do if(input.getkeydown()) for movement? Is the ! Necessary

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

      No, it's not necessary, of course. He just checked all reasons for leaving the method right at the beginning in order to get them out of the way/head. In this small piece of code, it might look weird, but it's a good style for bigger or more complex methods

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

      it's always better to check against something than checking for something, don't ask me why but I see it alot, I'm sure I'll learn why eventually :P

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

      if (input.getKeyDown(KeyCode.Space)) means if the key pressed is space, then do this code. The ! makes it NOT so if key entered is NOT space, then do this code. It is necessary for logic

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

    Thanks for amazing video.

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

    how do u put the networkBehaviour, I can't mine just appeared red. But if I used Using UnityEngine.networking, it said that the network behaviour will be depreciated

    • @ballboy2.029
      @ballboy2.029 4 роки тому +2

      add using Mirror to the list of libraries at the top

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

      @@ballboy2.029 it says Mirror cant be found. do i need to get the library from somewhere else?

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

      @@slime8045 Yes, download Mirror from the asset store and import it to your project.

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

      I have the same problem where I have imported mirror however when I write “using mirror” at the top of the script it doesn’t work

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

      have you guys got multiple visual studios downloaded? i think i may be that i have 2016 and 2019

  • @nawlian-mat5976
    @nawlian-mat5976 4 роки тому +6

    Is mirror really that great when talking about a larger scope ?
    Like, if i want to create an MMORPG shouldn't I switch to photon networking instead ?

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

      I don't really see why Photon would be any better necessarily. Have a look at github.com/vis2k/Mirror and assetstore.unity.com/packages/templates/systems/ummorpg-51212

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

      From stress tests it has been shown to hold 400+ players in a really small map

    • @nawlian-mat5976
      @nawlian-mat5976 4 роки тому

      Thanks for the answer. I used to struggle a lot when talking about unity's multiplayer assets without ever understanding what differentiated every of these networking systems.
      Do you have any documentation for that ?

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

      Nawlian - Mat also. You can’t make an MMORPG. It is literally nearly impossible as a solo indie dev, which I assume you are.

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

      @@GymCritical Assuming someone can't do something is quite close-minded. I'm not saying the odds of one person finishing an entire MMORPG are high, but flat out stating it's impossible is a little excessive don't you think?

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

    Will be great if some one can answer this question.. When you say the method CmdMove will be run on the server, where exactly will the code be placed. All the script files will be in available on both the server and client . So do we check using the code to see if this is a server or will this script be only placed on the server physical machine?

  • @user-th8pr7no5p
    @user-th8pr7no5p 4 роки тому +1

    Wont the client rpc tell ALL the clients to move? Why is only one client moving?

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

      if (!hasAuthority) { return; } makes it so that the Cmd is only for one user, then the client rpc tells all the clients to move. But the script is on each one of the players, so on the client rpc it should tell one object on each client to move. I'm not sure what your question is.

    • @user-th8pr7no5p
      @user-th8pr7no5p 3 роки тому +1

      @@spidernh honestly i dont even remember lmao

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

    the object is teleporting on the map because you're telling it to teleport by resetting it's Vector3 position.
    instead try and set it's rigidbody2d.velocity in the direction you want it to move;
    `rigidBody.velocity = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical")) * speed * Time.fixedDeltaTime;`

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

      Deltatime only needs to be multiplied when changing things over time. Here you are instantly setting the velocity to a value, meaning the body will now move at that speed (position change over time), but you are multiplying it with deltaTime, which makes no sense. Like saying it should now go at X meters per second per second, which sounds more like an acceleration and not a speed, but you are setting the speed to this value. Hope I make sense. :) To put it another way, the physics engine will already move the object at its velocity multiplied by the relevant deltaTime in the physics step, so no need to multiply by deltaTime when setting velocity. The deltaTime might even be different in the physics step than here.

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

    You are making my dreams come true :D

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

    "Weaver: stop because compile errors on target"

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

      Most likely you made a error with the script.

  • @GaLzZy.
    @GaLzZy. 3 роки тому

    Hi ! Nice video ! Just wanted to make sure, event if I use a client hosting kind of server, I still can have a full authorative server even tho the server is the host client or its better to have dedicated server when we want to have everything ran on the server ? Thanks

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

    To stop hackers from moving your character can you not just check if the input came from localPlayer ?

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

      Nope, because that localPlayer check is being ran on the client so it can still be hacked

    • @Justin-qr9mh
      @Justin-qr9mh 4 роки тому

      @@DapperDinoCodingTutorials I'm still working my way through your videos but do you cover the validation logic for these scenarios at any point?

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

    By adding command tag the ball jerks and moves when I press space. host one works good but the client one jerks. Not sure if its a problem or not

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

    If ClientRPC calls that translate method on all the clients, why pressing space didnt move all the objects.

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

    Nice tutorial! Just wonder what sort of project setting you used for the graphics?
    Mine is just in default 3d, the lighting and skybox doesn't look as good. Thx!

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

    Thanks for that very informative tutorial. I just got one question: With the ClientRpc function "RpcMove" you said that this method runs on ALL the clients, but why is only our client moving since we don't pass any Network Id to the server?

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

      "RpcMove" runs on all the client applications, but only applies for the single object where "CmdMove" was called.

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

      @@luisjs thanks!

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

      @@luisjs thanks!

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

      o.o

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

    Why not using Unity Netcode with Dots? That would be nice to see.

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

    hi thsnkd for the video
    any tips on how to connect vr headset to a network using steamvr and mirror ?

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

    steamVR please and also how to use DOTS with mirror ???

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

    I'm a bit confused, mostly out of ignorance. So creating the CmdMove function makes sense but why implement it within the player script if it's server code? Am I understanding that right? CmdMove method is executed as if it were the server? Why not create a method within the server code that validates and is called by the player and the player sends as a parameter a callback of RpcMove? And as for RpcMove I get that the server executes this method but what is the sequence of events here? When one player wants to move they call CmdMove which then tells the server to "move me" and then the server calls RpcMove but is RpcMove being called on every single player script in the scene at the same time or is it only calling RpcMove for the player script that initiated? How does this tie into syncing player positions?

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

    Hey! Love the Vids! I was wondering how do I get the Github Documentation of mirror onto Visual Studio or Visual Studio Code?

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

    movement script btw:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using Mirror;
    public class PlayerMovement : NetworkBehaviour
    {
    [SerializeField] private Vector3 movement = new Vector3();
    [Client]
    void Update()
    {
    if (!hasAuthority)
    {
    return;
    }
    if (!Input.GetKeyDown(KeyCode.Space))
    {
    return;
    }
    transform.Translate(movement);
    }
    }

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

    Quick question! I want to use the new input system and I'm using bools for button input and for some reason the bool isn't changing not sure if you covered this but how would I implement it into the game?

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

    network identity dosent work for me my playre script says there no such thing as networkBehavior

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

      Did you ever get this fixed?

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

      I just solved it, add 'using Mirror' (without the quotes) to the top of your player script, for example:
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using Mirror;
      public class Player : NetworkBehaviour
      {
      [SerializeField] private Vector3 movement = new Vector3();
      [Client]
      private void Update()
      {
      if (!hasAuthority) { return; }
      if (!Input.GetKeyDown(KeyCode.Space)){ return; }
      transform.Translate(movement);
      }
      }

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

      @@scottdarcy6062 Ok thx

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

      @@scottdarcy6062 yeh i got it fixed

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

      @@scottdarcy6062 Thx

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

    Please tell how i can implement validate Server Authoritative Movement? please i really wanted to know it somehow

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

    How did it work with you without "Using Mirror;" ??

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

      He's using a namepsace, I think that's why.

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

      @@acfgcnbjh actually I saw this clip yesterday, I think that "use mirror" added itself when he changed to NetworkBehavaiour ...
      But thank you anyway :)

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

      holy potato you are a life saver, thank you so much, i was stuck on that for soooo long :))))

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

    great now how do i assign a camera to use just the client but its not the parent in the prefab.

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

    If I change my player and input scripts from mono behavior to network behavior will they still work on offline mode? I have a PVE option and a local co op option also and I don’t want to break them.

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

    I am doing everything like you did but for some reason the last player that joined controlls all players

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

    Moving with RPCs brings a latency, of course. A better approach could be to still allow the client to move locally, but let the server decide if the position change was correct and to change the position back, if a cheater teleported, for instance.

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

      I'm stuck in implementing this, any help?

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

    Watch out if you are using the new input system!! (see below)
    Problem: You can't put the "PlayerInput" component on every Player Prefab you want to spawn and move, it won't work if you have more than 1 PlayerInputs
    My solution:
    1) Create a new GameObject with the PlayerInput component
    2) Create a new script to overwrite the Network Manager Script (to do that, just make a new c# script and replace "MonoBehaviour" with "NetworkManager")
    3) Override the OnServerAddPlayer() method
    4) Instantiate the players as a child object from a GameObject with the PlayerInput component
    5) For new user joins, you need to check in the start method of Player.cs if the current players are already a child of this gameobject:
    if (!gameObject.transform.parent)
    {
    gameObject.transform.parent = FindObjectOfType().transform;
    }
    I hope this helps, thanks to DapperDino for the great video!

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

    Can I multiply movement with time.DeltaTime to make it smooth?

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

    Mobile joystick not working after applying this. Can you help ?

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

    i'm getting this error in unity "NetworkBehaviour namespace could not be found" and i'm stuck right here

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

      just add a library in your script: Using Mirror;

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

      @@muskito doesnt help

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

    Anyone get "The type or namesapce name "Steamworks" cannot be found (are you missing a using directive or an assembly reference)?

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

    For me, the [Client] Tag produced an "Invalid IL code" error. I had to remove it!

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

      Are you using Unity 2020.2? I think that's an issue that is yet to be solved so I'd recommend using 2020.1 for Mirror at the moment

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

      Thanks for saying this! i couldn't work out what the issue was but it was this! still an issue today on 2021.1.13f1

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

    Can someone help me? When I type anything having to do with mirror, visual studio isn't recognizing it and underlining it in red. I said using Mirror and yes the game works but visual studio says its wrong... I'm not on visual studio community, just vs

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

    Hey Dino. Command in client, client can remove Command ??

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

    I'm trying to make my own thing from scratch, right now I have an issue where the client never has authority. Is there something you do in this tutorial to give the client authority? if so I can't find it.
    Edit: I figured it out, but im keeping the comment here so if other people get this issue they can see how I fixed it. It was literally just that I had "NetworkManager List Server" as my component instead of "NetworkManager". I'm dumb.

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

    hi man when i did the same code of the clientRpc Movement but i just changed it to rigidbody movement the players movement didnt synced can u help me with that ?

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

    I tried changing the MonoBehaviour to "NetworkBehaviour" but it was underlined in red when I did that. I have added "using Mirror;" but that just gets underlined too. Why is this?

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

      i just typed it in at first and it wouldnt work. i started retyping but i let it finish the word for me and it worked.

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

      I was using Unity 2019.3.12f1 and it had the same issue for me, try using older unity like Unity 2019.1.5f. This did the trick for me.

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

      @@kaloczikvn Thanks mate!

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

      change the namespace to Mirror i.e wrap your NetworkBehaviour with: namespace mirror {class goes here}

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

    The player on the client will not move for me. Any ideas?

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

      You have to give Client Authority 5:47

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

      @@alfenstein6356 yeah I did that, might have missed my other message that explained what I did wrong. Basically I was running an old build, I had to delete it and build from scratch because just building wasn't overriding the old build for some reason. Thanks for trying to help anyway!

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

    i don't understand the RpcMove() part, i've already used Rpc with photon, but now you called RpcMove() for every client, but why not every player move at the same time then? because of authority?

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

    Hey, I have a problem. Everytime I use Mirror, it adds CapsuleCollider and Rigidbody to my character. Anybody knows what the cause of this may be?

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

    7:06 Why Dont We Use isLocalPlayer?

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

    Can somebody explain what the server is? Is it the hosting client itself or a second instance running on the hosting client? And technically can't the hosting client then easily cheat?

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

    If you make the server validate ALL player movement, wouldn't that make player movement have massive input delay based on ping?

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

      Need to implement client side prediction which is difficult but prevents cheating

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

    hi im working on a small project its a unity2d topdown 4 directional movement and shooting multiplayer game i got the movement and faceing right but still have problem on the client tho i cant make him shoot in diferent direction it only shoot in the default direction is any one here good at unity networking i dont know how to make the direction var works on the client public int direction????

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

    whenever i put if(!hasAuthority) {return;} it just disables all of my script below except for movement and turning around!!! Does anyone know what to do to fix this?

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

    Wait! I appreciate that you already have a NetworkManager, but how did you add it in the first place?

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

      I guess you've figured it out by now, but it was in his previous tutorial. You add it on 'Add Component' in the Inspector tab.

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

    Thanks!!!

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

    how to play sound on client and server ?

  • @ballboy2.029
    @ballboy2.029 4 роки тому

    would you be able to connect using the port "localhost" even if you aren't on the same wifi connection as the server host?

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

      If by not "on the same WiFi connection" you mean across the internet then you'll probably need to setup port forwarding on your router. Unless you use a network transport that can do Nat punchthrough.

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

    I have a problem, when i run, the ball doesnt move, but makes a clone that moves and stays the same place, someone know how to fix it?

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

    idk if anyone has asked yet, but why did you use a namespace here? new to coding, just asking cuz I don't think you mentioned it

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

    In your patrons, you didn't say the Russian guy's name lol :). But I don't get something.... Why the 1 dislike though???

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

    How do I validate?

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

    When I input your tutorial folder into my unity I immediately get errors and cant run anything. Is there a typo in the script?

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

      u tried using the same unity version? also i havent importerd his tutorial

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

    How can we change HUD ui ?

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

    I want to create a simple multiplayer card games for 2-4 players. Is there a way I can use mirror to make such games with random matchmaking and other stuff?

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

    Sir Multiplayer game has 100 players and if you want to play a game with 100 players of 4 friends, how can you invite 4 friends?

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

    hi how i can put cameras for every player and everyone see their own camera?
    Edit: i watched tutorials and problem is solved