@@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.
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 !!!!
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 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
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!
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
@@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
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
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?
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
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 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?
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?
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.
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?
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?
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
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!
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?
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?
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
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
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?
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
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.
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?
@@acfgcnbjh actually I saw this clip yesterday, I think that "use mirror" added itself when he changed to NetworkBehavaiour ... But thank you anyway :)
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.
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
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
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.
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?
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 ?
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?
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); } }
Hey Dapper Dino, I am having a problem with adding two different player prefabs to the main scene. I want player 1 to use prefab 1 and player 2 to use prefab 2 as their player controllers. The reason why I am trying this is because I want each player to look different to the other, do you think you could help? Thanks so much!
If you want to have player 1 be one color and all the others to be a different (but same) color then do if (hasAuthority) { this.spriteRenderer.color = color; } else { this.spriteRenderer.color = color2; } if you want all colors to be random, do this: this.spriteRenderer.color = color.random; (I'm not sure about the second one, check the documentation and just set it to a random color instead of color.random.) You can also do this with textures, just change the texture instead of the color.
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?
Video Liked, but i have a question for this Tutorial. I've tried to move my player with 2 Inputs A and D for left and right movement but if call both inputs in the update method, the player wont move anymore. if i call just 1 input in the update method, it moves. why does it not move if i try to use more inputs for several directions? i used the call in the tutorial for your update method -> if (!Input.GetKey(A)) {return;} and the same for D but both return values together causes a bug, where im not able to move the player anymore. is that normal? and how can i use multiple inputs for command? it would be very usefull to know :)
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?
the files are stored locally, mirror just sends very small bits of info (this player moved over here, this player is using that cosmetic) but not actually the models etc
@@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!
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.
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.
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
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.
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????
Make sure to put at the top using Mirror;
thanks :D. i was trying to get the "NetworkBehaviour" working but couldn't figure out why it was not working
@@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.
Thanks Man! you saved my alot of time. :)
@@BannedFromJordo right, this is the most important thing for the script and he didn't tell in the video. Maybe he forgot.
so, when im putting it at the top, it doesn't shown up and "using mirror" doesnt work
When using *networkbehaviour* you will need to add "using Mirror;" at the top of the script, for example, directly below "using UnityEngine;"
u saved my life
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 !!!!
you're a saviour
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.
same here
however there are not alot of tutorial about mirror :(
@@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
this series is so helpful. I love it, u really deserve more subs
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!
This is a really clear tutorial, Thanks!
behavior vs behaviour ....people separated by the same language :D
Great work here, thanks!
0:12 "and stole it ,aaaaa, sorry open in Unity" XD
Very good tutorials, explanation 1000 and understanding and cover many things
Awesome! Just what I hoped for
Glad you found it awesome :D
You should make more mirror videos theyre really helpful :)
Yep I will be making plenty more :)
Yeah bro is is brilliant like always!!
Awh, thanks :)
I love it!
Thank you for this amazing tutorial!
Very well explained!!
Very detailed in describing how this how thing works. THanks
what is the different of [Server] and [ServerCallback]
Also what is the difference of hasAuthority and isLocalPlayer
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
@@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
Thanks for your video, great explanations, great rythm
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
You can use UnityProjectCloner from hwaet on github. It's the as Uecho. I really recommend it instead of building your project each time
@@goldytack I'll try it out, thanks a lot!
make sure to put Using Mirror; just below where it says Using UnityEngine or your script wont work at all
fuck this series is so good man, thanks for your time
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?
It is Work?
Why does the networktransform component not sync anything AT ALL for me? I don't understand what I'm doing wrong...
Thank you very much for this effort👍
You are making my dreams come true :D
Nice video! Is there a video of you where you show how to check the player authority on the server? Would be super helpful.
how did you do the server stuff did you created it alone or you bought a amazon cloud server or google cloud server?
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 ?
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
From stress tests it has been shown to hold 400+ players in a really small map
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 ?
Nawlian - Mat also. You can’t make an MMORPG. It is literally nearly impossible as a solo indie dev, which I assume you are.
@@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?
Thanks for this amazing tutorial bruh
Thanks for amazing video.
No problem :) Glad you enjoyed
I tried export to android and i have one bug "A connection cannot be established as the target computer expressly denied that connection."
I'm thinking of creating a multiplayer fps for LAN hosting - mirror or photon?
Just for LAN? Regardless, I'd say Mirror since you don't have to pay and it's a lot simpler in my opinion
@@DapperDinoCodingTutorials Ah okay, will you be covering how to set everything up and implement it into games?
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?
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.
Problem "The name 'hasAuthority' does not exist in the current context" is update to => hasAuthority = isOwned
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?
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?
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
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!
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?
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?
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
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
add using Mirror to the list of libraries at the top
@@ballboy2.029 it says Mirror cant be found. do i need to get the library from somewhere else?
@@slime8045 Yes, download Mirror from the asset store and import it to your project.
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
have you guys got multiple visual studios downloaded? i think i may be that i have 2016 and 2019
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?
"RpcMove" runs on all the client applications, but only applies for the single object where "CmdMove" was called.
@@luisjs thanks!
@@luisjs thanks!
o.o
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
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.
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?
whenever i connect a client, the host and client use that new player?How do i keep the host using the original player?
If each player prefab has it's own camera, you need to write a script that disables it if it's not the localPlayer.
Hey! Love the Vids! I was wondering how do I get the Github Documentation of mirror onto Visual Studio or Visual Studio Code?
How did it work with you without "Using Mirror;" ??
He's using a namepsace, I think that's why.
@@acfgcnbjh actually I saw this clip yesterday, I think that "use mirror" added itself when he changed to NetworkBehavaiour ...
But thank you anyway :)
holy potato you are a life saver, thank you so much, i was stuck on that for soooo long :))))
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
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
7:06 Why Dont We Use isLocalPlayer?
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
Please tell how i can implement validate Server Authoritative Movement? please i really wanted to know it somehow
hi thsnkd for the video
any tips on how to connect vr headset to a network using steamvr and mirror ?
plz can somebody help me i got stuck unity tells me that !hasAuthority isnt known
To stop hackers from moving your character can you not just check if the input came from localPlayer ?
Nope, because that localPlayer check is being ran on the client so it can still be hacked
@@DapperDinoCodingTutorials I'm still working my way through your videos but do you cover the validation logic for these scenarios at any point?
Hey Dino. Command in client, client can remove Command ??
Wont the client rpc tell ALL the clients to move? Why is only one client moving?
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.
@@spidernh honestly i dont even remember lmao
The Telepathy Transport uses TCP. Isn't UDP better suited to face paced games like shooters?
Why can't you just do if(input.getkeydown()) for movement? Is the ! Necessary
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
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
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
great now how do i assign a camera to use just the client but its not the parent in the prefab.
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.
personally i use parents object to separate an categorize my project
If ClientRPC calls that translate method on all the clients, why pressing space didnt move all the objects.
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?
Exactly my question
i need an answer for this question.....
ikr, how??
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 ?
steamVR please and also how to use DOTS with mirror ???
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?
network identity dosent work for me my playre script says there no such thing as networkBehavior
Did you ever get this fixed?
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);
}
}
@@scottdarcy6062 Ok thx
@@scottdarcy6062 yeh i got it fixed
@@scottdarcy6062 Thx
Why not using Unity Netcode with Dots? That would be nice to see.
"Weaver: stop because compile errors on target"
Most likely you made a error with the script.
Mobile joystick not working after applying this. Can you help ?
Can I multiply movement with time.DeltaTime to make it smooth?
Wait! I appreciate that you already have a NetworkManager, but how did you add it in the first place?
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.
When I input your tutorial folder into my unity I immediately get errors and cant run anything. Is there a typo in the script?
u tried using the same unity version? also i havent importerd his tutorial
Hey Dapper Dino, I am having a problem with adding two different player prefabs to the main scene. I want player 1 to use prefab 1 and player 2 to use prefab 2 as their player controllers. The reason why I am trying this is because I want each player to look different to the other, do you think you could help? Thanks so much!
If you want to have player 1 be one color and all the others to be a different (but same) color then do
if (hasAuthority) {
this.spriteRenderer.color = color;
} else {
this.spriteRenderer.color = color2;
}
if you want all colors to be random, do this:
this.spriteRenderer.color = color.random;
(I'm not sure about the second one, check the documentation and just set it to a random color instead of color.random.)
You can also do this with textures, just change the texture instead of the color.
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?
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.
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.
@@kaloczikvn Thanks mate!
change the namespace to Mirror i.e wrap your NetworkBehaviour with: namespace mirror {class goes here}
Video Liked, but i have a question for this Tutorial. I've tried to move my player with 2 Inputs A and D for left and right movement but if call both inputs in the update method, the player wont move anymore. if i call just 1 input in the update method, it moves. why does it not move if i try to use more inputs for several directions? i used the call in the tutorial for your update method -> if (!Input.GetKey(A)) {return;} and the same for D but both return values together causes a bug, where im not able to move the player anymore. is that normal? and how can i use multiple inputs for command? it would be very usefull to know :)
use if(INput.GetAxis("AxisValueHere") { code to move player }, i recommend watching videos on movement since this is a vey bad way to do it
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?
yes
Anyone get "The type or namesapce name "Steamworks" cannot be found (are you missing a using directive or an assembly reference)?
I am doing everything like you did but for some reason the last player that joined controlls all players
does mirror works well with large 3d projects (about 5gb) ?
and thanks for this awesome tutorial
the files are stored locally, mirror just sends very small bits of info (this player moved over here, this player is using that cosmetic) but not actually the models etc
@@Kira-zf7te thanks for the reply
The player on the client will not move for me. Any ideas?
You have to give Client Authority 5:47
@@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!
i'm getting this error in unity "NetworkBehaviour namespace could not be found" and i'm stuck right here
just add a library in your script: Using Mirror;
@@muskito doesnt help
If you make the server validate ALL player movement, wouldn't that make player movement have massive input delay based on ping?
Need to implement client side prediction which is difficult but prevents cheating
Will this tutorial series work for FPS games too?
yes, mirror is online, it doesn't matter what you're doing with it.
@@spidernh Ah, I see
would you be able to connect using the port "localhost" even if you aren't on the same wifi connection as the server host?
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.
Thanks!!!
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.
I'm stuck in implementing this, any help?
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
NetworkBehaviour not working on the newest version of unity, is there any way to fix it other than switching to an older version?
If you put using Mirror; it will work. I haven't tried coding yet but I assume it fixes the problem
Yeah It does! I eventually figured it out, thanks anyway
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.
a comment for the algorithm ;)
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????
For me, the [Client] Tag produced an "Invalid IL code" error. I had to remove it!
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
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
Nice
Nicee
Niceee
Niceeee
Niceeeee
You Win :P
What is validation? How to do it? 11:00
YOU SAVED ME 10 HOURS OF LOOKING FOR ANSWERS THANK YOU SUB + 1 AND LIKE + 1 GOOD HOB MAN LOVE YOU :)
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?
hi how i can put cameras for every player and everyone see their own camera?
Edit: i watched tutorials and problem is solved
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?