Want to support me just a little? I got a game made on FishNet releasing on steam! If you'd wishlist that, i can't ask for more! store.steampowered.com/app/2349410/Forging_Ahead/ If this was helpful a like is much appreciated! And if you subscribe i might faint? :O If you have any issues, feel free to put them in the comments. I will do my best to help you out! Also, join the discord here: discord.gg/HRfzz58NYk
@@Maskeowl What exactly do you mean by not being able to use the main camera? There are some alternatives. You could first of all reference it by tag: GameObject.FindGameObjectWithTag("Tag").GetComponent(); An alternative is to have a camera for each player and reference that directly somehow (maybe by having it being a child of the player prefab) and then disabling the other players camera. Hopefully this answers your question. Looking forward to hear from you :-)
@@Maskeowl Maybe take a look at 3:32 again? This part is extremely important, since this is what stops you from being able to control other objects than your own. I believe you might have messed up something here. You can also try and link your script in a pastebin and i can take a look. You can also join the discord here to get more instant help discord.gg/HRfzz58NYk
THIS IS ABSOLUTELY GREAT CONTENT! No honestly, quick, percise, well-explained and straight to the point, perfect for someone like me wanting to get into Multiplayer! THANKS a LOT!
I watched your tutorials once and they helped me now i tried to make it on my own and IT WORKED THANK YOU SO MUCH I STARTED LEARNING MULTIPLAYER FROM YOU AND NOW I KNOW SOMETHING FROM MULTIPLAYER
bro this is an S-tier tutorial for Fishnet. I just finished watching Episode 2 and came back here to comment, because anyone watching this ought to know that this is a nice little bonfire to start from. I've been using unity networking tools for about 4 years now. As a self-taught who only really is familiar with C# and a small bit of Unity ECS, I'm thinking fishnet might be a superior solution for implementing game state reconciliation. also... >when the capsule is sus
@@BobsiTutorial don't burn out though! I watch a video recently of a game dev who got sucked into youtube so much that he burned out. he just wanted to write code, y;know? and ended up running a community and acting as teacher! give yourself some nice boundaries.
@@alyssafaden9443 I see what you mean, and in some way i do feel a little bit of pressure from all the positive feedback. That being said, i honestly feel extremely motivated from the great feedback from everyone, and so far it has only made me more productive :-) But i'll do my best to watch out. Thank you!
idk why but i was really surprised on how little code you have to write and how smooth it is another point that sold it for me was that you said i could write code like i was in singleplayer overall great tutorial, im definitely going to use this tutorial series for my next project
Nice quick tutorial on FishNet setup! Since I was starting a new project, I had to pause to get the "single player" movement out of your pasted in code. Otherwise, great info, good pacing, nice editing!
THANK YOU FO9R DOING THIS TUTORIAL,ITS SO SIMPLE THAT I HAVE NO DOUBT THAT ILL FAIL, OI HAVE BEEN STRUGGLING WITH PHOTON AND IM ALWAYS FOLLOWING 9-15 MINUTE TUTORIALS(its just two videos)AND PHOTON WORKS BADLY EVEN AFTER DOING THE SAME STEPS AND FOILLOWING THE VIDEOS ONE BY ONE, THANK YOU FOR THIS TUTORIAL
IMPORTANT IMPORTANT IMPORTANT IMPORTANT * If you receive errors about missing Mirror components, * such as NetworkIdentity, then remove MIRROR and any other * MIRROR defines. * Project Settings -> Player -> Other -> Scripting Define Symbols. * * If you are also using my assets add FGG_ASSETS to the defines, and * then remove it after running this script.
Thanks, working great in 2024. Just one thing to be aware of is that the player controller seems to default with fishnets player controller script, so you need to remove that component to attach the script you provided.... otherwise the camera doesn't work because it doesn't get assigned.
@@BobsiTutorial i get this error NullReferenceException: Object reference not set to an instance of an object PlayerController.OnStartClient () (at Assets/Scripts/PlayerController.cs:37
@@BobsiTutorial like who will not??? Firstly there was an error that i needed to assign a spawnable prefab, and i selected default prefab. Anyways thank you bro
@@CodingCenter1 Yeah, that error started showing an update that came a month or so after the video was uploaded. Luckily it tell people exactly what to do, so most will understand quickly.
@@BobsiTutorial but its little bit confusing like i am faceing many errors and dont know to solve like last one when build and run have to do that time error
@@BobsiTutorial not sounds strange as i am to lazy😅😅 and have a very very very best idea in a making a game so ito do that i need some different 3d games and dont know much how to create and because aso need a partner to. I think that you can understand me what my feeling want to say.😁😅🤣🤣
Hi, I downloaded this resource, and when importing it, a window appeared in which I clicked "Yes". In the "Console" section, I was given \FishNet\Upgrade\Mirror Upgrade.cs(16,7): CS0246: Could not find the type or user name "Mirror" (are you missing the using directive or assembly link?)
Hey man. I am a Unity Dev who's trying his hand at Networking for the first time. I found Fishnet, and through browsing some resources I found your video. Well done! I have a question for you. Do you cover server authoritative movement or actions in any of your videos? If not, do you know any written material or videos that does? The Fishnet channel has a video on it, but it's very barebones. Any help is appreciated, I subbed. Cheers man!
Thank you for the kind words! Very happy to hear that you like the videos. Unfortunately, i don't have a video or any material on this topic. It is something i looked into very briefly, but it seems to be a different kind of beast. The best i can recommend is probably playing around with the example that is included in the FishNet examples :-)
Thanks for your great tutorial - I have one question though How are you able to run 2 instances of the game (like you do on the 6:20 mark) to test the clients?
Hmm, probably a bit too specific in terms of games, but a full shooter game series is something that is being worked on for Alteruna ^^ If you are sticking to FishNet, a lot of the logic should apply directly across any networking game.
@@BobsiTutorial i got one question though, when i join the game it all works but when i press the space bar it dose not make me jump, instead it say that the camera is no longer active... i think this is because when the space bar is pressed the game thing i pressed the client button and it closes my camera. do you know how i could fix this?
@@brickworkproductions2849 This is only an issue in the unity editor. Just click the screen after you started playing before pressing space bar 🙂 Unity remembers the last button you pressed and will press it again when you click spacebar. So simply just click anywhere else in the game view after starting.
hey! Great video. How can we get this to work via separate computers? As I have it working on the same PC, but having the server on one computer and the client on a different one doesn't work. Thanks!
You need to add "Tugboat" to the network manager. From there you will see "localhost" Change that out with an IP on the same network. If it shouldnt be on the same network you will need port forwarding or a tool to connect networks like ZeroTier :-)
@@bblakeyyy @bblakeyyy Which Photon do you use? Keep in mind that PUN is quite old and not very performant at this point. That is why i switched to FishNet in the first place :-) I used to work with PUN
@@BobsiTutorial I used PUN 2. I'm using it for a TH-cam video where there will never be more than 2-3 players in a server at any given time, and will only be active for a day or so while I record. If I was building a game for longevity I would consider my options more, but this is much more temporary :)
@@bblakeyyy If it is just temporary and to play around with, that is just fine. But i noticed alot of things with PUN that was just really slow. In general the networking is just... slow. Network Transforms, RPC calls, etc. Slow. Fishnet is soo much faster with even the primitive stuff. But again, i also started playing around with PUN, and it is good for learning. FishNet is structured practically the same for the un-experienced network user :-)
hey i wanted to ask you a question, is this networking solution like mirror, where a client acts as a server and other clients join?(and does it support android?)
It can be. When developing, yes. Then it is a Host-Client setup. However, you can also choose to host it on a server, steam servers, unity services, etc. It is really up to you. And yes, it does support phones.
Absolutely, but it is much more of a general networking question than a FishNet one. It is mostly up to you as the developer. There are a lot to doing such, for example load balancing, server plotting, etc. Might be interesting for you to look into Alteruna, since they handle the entire server structure for you. They are currently expanding their servers to more regions as well.
Hey, it would be great if you could answer. So im creating an mobile Multiplayer game. Everything is ready and setup, so when i start the server from my main phone and click client on my 2nd phone, the 2nd phone will just not connect. However, when i then changed the build platform to windows and built the project, it worked. Do you have an idea, on how to make it also for mobile? Thanks in advance
I am not sure, I don't develop for phone myself. But I do know it can be used for phone just fine. Maybe try and ask in the FishNet Discord ^^ I imagine it being your setup with a server that might be a bit off.
i have been trying to get multiplayer working but with no success, i tried multiple versions of unity and it always comes up with the same error The type or namespace name 'Connection' does not exist in the namespace 'FishNet' (are you missing an assembly reference?) The type or namespace name 'Object' does not exist in the namespace 'FishNet' (are you missing an assembly reference?) The type or namespace name 'NetworkBehaviour' could not be found (are you missing a using directive or an assembly reference?) The type or namespace name 'NetworkBehaviour' could not be found (are you missing a using directive or an assembly reference?)
Sounds like Unity doesn't compile the FishNet import correctly, or your IDE doesn't see it properly. It would be either of those really. Tried restarting Unity and your IDE after importing? And make sure to not initially move the FishNet folders location, as that messes with the assembly
@@BobsiTutorialthanks for the advice and responding do quicky, i have restarted my IDE and restarting my unity and now i have another error on top of that PlayerCharacterController.cs(145,30): error CS0115: 'PlayerCharacterController.OnStartClient()': no suitable method found to override i was just wondering if there was something wrong with using unity 2021.3.33f1? since before resetting my pc networkbehaviour still use to worked edit: i am going to install it on my laptop to see if the pc is the problem edit: still have the same problem on the laptop as well idk what is causing this. my old projects also now have errors which it didnt have before.
Try selecting "DefaultPrefabsObjects.asset" in "Spawnable Prefabs" NetworkManager's "Prefabs" section when you placed the NetworkManager Prefab. It fixed the problem for me
Hey Bobsi, I followed the tutorial and it was great, super easy to follow. However, I do have a question, I did the test where I was able to build it and run it through two instances, however when I wanted to test if it would run through different computers it seemed to not work. How do I fix this, or is Fishnet only for local multiplayer rather than an online multiplayer that I was looking for?
FishNet is very much for online multiplayer. Just depends on your server setup. By default it is set to use localhost, meaning it is purely local. On the Network Manager you can add the TugBoat component (if it isn't there already) Here you can see where it says "localhost" and throw in your local IPv4 for both you and another lan computer, and then you'll have working Lan. I have a video on how you play with friends on my channel for free as well but using this method, but simply connecting your ethernets with a third party tool.
how would I do this with a rigid body player script? im stuck on the ".enabled" thing for a ridged body. Also I need multiple cameras for camera effects.
If you want a rigidbody to work properly over the network, you would have to do some movement prediction. Try and look into a rigidbody example on fishnet. It is a bit more advanced 🙂 but in the end, it should still "only" be the movement script you would want to disable, and not the rigidbody component, if you do it right.
Hey I have followed this tutorial 3x and I keep running into the same issue. This seems to be an ownership problem... Server can move around however when client joins the server changes camera view to the new instantiated client player but still only moves the server player. Server can't see client move around at all. Client player can move around and can see server player move around Used the script provided by your pastebin link without changing anything in it. followed the creation of the spawn point too using fishnet pro not really sure how to fix this issue so if you have any thoughts please let me know so I can try them. sorry if this comment is doubled up youtube seemed to have deleted my last comment
Hmm, sounds odd. Have you ensured that the ownership check in the beginning of the script is correct? Sounds like something might not be disabling properly for other players, or the network transform isn't where it's supposed to be, possibly.
@@BobsiTutorial After doing some debugging I found the problem was with the main camera??... I have instead added a camera to the player prefab and turn it on if they are the owner instead and this seems to be working fine. thank you for your help in this even though I am sure you are busy working on Forging Ahead
Thank you 🙂 Something tells me that you are missing a reference somewhere? Did you set it up correctly in the inspector? And which script is this error being called from?
Hey Bobsi, nice video. I'm running into an issue which is on most of the tutorials. This only shows LAN multiplayer right? How can I get this to play a multiplayer game with my buddy across the internet. It really seems like NO tutorial ever covers this and it's quite frustrating. I'm always able to do a LAN test, but my goal is to play with friends across the internet, not in my own house on my same machine. Any way you recommend to do this?
@@BobsiTutorial Hi Bobsi! I have, I've looked at a majority of your videos, maybe there's something I'm missing. If you could please link me to all of those, I would love it. ALL I want to do is make pong or a simple game, and be able to play with my friends online. However they always are only LAN, or require port forwarding. I just want to send a Unity build to my friend over the internet and have him be able to play pong with me. Can you please link me to some videos that will guide me in the right direction towards doing that? I followed your entire pong video completely. Please, I've been looking for weeks.
If it works, I will donate to you, please whatever you need. I just need to play a game with my friend over ONLINE, NOT LAN. not on the same device. different devices, different houses and locations.@@BobsiTutorial
Hi Bobsi, I took a look at the PlayFlow video twice now. It seems like everything is already set up in this video.. again I'm a bit confused here, so I have to watch the "networking animations video", the "fishnet set up tutorial entire series", and, "connection starter video" for how you set up FishNet? So I need FishNet and PlayFlow together for this? I'd just like a start to finish on how to get this done, but it seems like everything is jumbled up and requires hours of previous set up, which is fine but I just wish to know which all videos would be needed in which orders completely.@@BobsiTutorial
Nice tutorial! I am having one issue though. When I am ingame the cursor locks and I am not able to click on gui ( cant click server and client buttons since there is the cursor. Any help?
Great tutorial! I have a problem though, I cannot run the programme on my oculus quest 2, do you have any idea why that might be? It seems to me like the code is too big and requires too much computational power, infact when I run the apk app on the oculus at first the scene moves as I move my head, then the fans start running and then the app simply shut down before I can even actually enter the virtual workspace.
Thank you for the kind words. Does it work fine for you if it is not multiplayer setup? The multiplayer setup should not dictate wether it runs for you or not at all! It is after all "just" a big library, and nothing else. So it absolutely should work for you. Or maybe your computer can't handle it? no matter what, the multiplayer setup should not have anything to do with it 🙂
@@BobsiTutorial I fixed it and it now runs on my vr. Although, it doesnt run properly: if I click play in unity and just have the game starting in the simulator then one player clone will show. Then if I run the app on the oculus (after installing it through oculus developer hub app for pc) it wont give me the option to choose between server or client, so i changed the code in a way that it runs directly the client option (I commented lines 152-158 and subsituted them with OnClickClient(); ) But still, it doesnt actually show on the editor that a new clone joined, what should I do?
Hello! I know this is an older tutorial but I would still like to ask for help. So all is fine except from when I go to build the game, upon building I get two errors: - "CachedNetworkObject" does not contain definition for "SceneName" and no accessible extension method - "CachedNetworkObject" does not contain definition for "ObjectName" and no accessible extension method Unsure if this is a common error but so far I have tried restarting Unity, reimporting FishNet and restarting my IDE Thanks for any help you could give ^^
hi. great video! but I have a problem. I cant reach to the player controller script from the description. the link does not work for me. is it possible for you to provide a different link? thx
@@naufal6560 As mentioned. It still just runs as a regular PC game, so setup should be basically the same. I imagine the head and hands should just be looked at, as the player instead.
When I try the build the capsules are cubes, and they float in the air at the spawnpoint, and the camera is in the default starting position like in a new unity project
It was a standard in the older version, not sure why it isn't anymore, so that is unfortunate. So I didn't forget, it just wasn't an issue at the time of recording.
I got this video on how to play with friends using software to connect internet: th-cam.com/video/tg_kl2bYdv4/w-d-xo.html If you want it on a server you have to look into how to do a dedicated server setup which is quite a bit different. Not something i got a guide on 🙂 You could also using something with FishySteamworks which helps connecting fishnet and steam servers. This is also a complicated case if you are new to multiplayer 🙂
@@BobsiTutorial thanks so much I found a hosting sight called playflow which works with fishnet so I will use that but will look at the steam thing cause I'm going to upload my game to steam at some poijt
Hello, really great tutorial you've made here, you've earned a sub☺️ However, when I click the client button, I get the error "The variable _graphicalObject of Predicted Object has not been assigned." The documentation was too difficult for me, any idea how to fix this?
Thank you very much for the sub and kind words! 😀 I saw another guy in my discord with this issue. I believe he needed to update FishNet, since it was a FishNet version issue. Otherwise a restart of the Unity editor might do it 🙂
Sounds like multiplayer is a little early for you ;-) Object reference errors are typically the easiest to solve. Simply means some piece of data which you are trying to grab data from or manipulate doesn't exist (the reference to it, that is)
@BobsiDev the camera does exist though. I tried to put it on the prefab(didn't work), on the scene as a game object(didn't work), make the camera grabbing manual and then dragged it on the prefab(didn't work), put the camera module on the prefab(didn't work). The thing is it worked on the previous player prefab that I accidentally deleted:(
Just simply convert multiple scripts 🙂In my multiplayer games I can easily have 10+ scripts on a player. It is not an issue. Can actually help you organizing quite well.
You can play with anyone across the world if you set it up for it. This tutorial shows just a local setup. But I have other videos showcasing using zero tier for testing, or dedicated servers for hosting. Or even steams relay (which is free with the steam access)
hello. i have problem when i use server button all works normally but until i click client after that i can't move camera ps: i'm using the FPScontroller package from unity 2018.1
@@ZRD1337 What do you mean "from camera object". Does it use Camera.main? Does it include its own camera? Is the FPS controller package setup to work with multiplayer? There are alot of questions needing to be anwered. I always recommend you start out with making your own basic FPS controller and not using any assets, not even included in Unity. It makes it much better for you to convert to multiplayer, because you need to know what is going on before you can really start modifying it 🙂
This is taken from their own Discord, but i think PlayFlow is a good option. I don't have any experience with dedicated servers with fishnet, but maybe go give it a look 🙂
Finished this video fully and I got the LAN working. however my characters are floating high up off the ground, maybe because the spawn points were set too high? Do they need rigid bodies?
so if the parent object, the "create empty player" If the parent is at 0, 0, 0, should the child object also be at 0,0,0,?? but then the graphical is inside or UNDER the ground.. so it needs to be offset. no?@@BobsiTutorial
@@FenrirPoker Highly depends. But keep in mind that the coordinates on the child is not world space like it is on the parent. The child coordinates are local space.
local space meaning relative to the parent object? I see. okay I have to do a bit more research on this to have a full and balanced understanding. I'm 2 weeks into unity, so still learning.@@BobsiTutorial
For me when i press play for some reason my mouse in on mouse lock so when i try to press client it just goes back into mouse lock and when i try to build settings and save to assets it says "Building to the Assets folder is not allowed." but you did it in the video so do you know why this is happeing? if not no problem. Love your content btw!
Absolutely! It was really just to make things more clear for people who are not good with existing inheritance and such. But I do that in newer videos.
Hello Bobsi. First, thanks for this tutorial ! I'm a little bothered with the multiplayer because when i click client, every thing seems to work, but when another person clicks client even if he have not my ip, it doesn't work anymore, he takes my perspective and i can't move anymore, i'm at spawnpoint and every functions of my others scripts don't work for him anymore. Can you help me please ?
Want to support me just a little? I got a game made on FishNet releasing on steam! If you'd wishlist that, i can't ask for more! store.steampowered.com/app/2349410/Forging_Ahead/
If this was helpful a like is much appreciated! And if you subscribe i might faint? :O
If you have any issues, feel free to put them in the comments. I will do my best to help you out!
Also, join the discord here: discord.gg/HRfzz58NYk
what if we cant use the main camera what i should do help
@@Maskeowl What exactly do you mean by not being able to use the main camera?
There are some alternatives. You could first of all reference it by tag: GameObject.FindGameObjectWithTag("Tag").GetComponent();
An alternative is to have a camera for each player and reference that directly somehow (maybe by having it being a child of the player prefab) and then disabling the other players camera.
Hopefully this answers your question. Looking forward to hear from you :-)
@@BobsiTutorial letme try what you said thnks by now (sory my inglish little (a lot) crunky)
@@BobsiTutorial naaah i cant do any think its broken weqewqewqeqw i think first client or other controls every body
@@Maskeowl Maybe take a look at 3:32 again?
This part is extremely important, since this is what stops you from being able to control other objects than your own. I believe you might have messed up something here.
You can also try and link your script in a pastebin and i can take a look.
You can also join the discord here to get more instant help discord.gg/HRfzz58NYk
THIS IS ABSOLUTELY GREAT CONTENT! No honestly, quick, percise, well-explained and straight to the point, perfect for someone like me wanting to get into Multiplayer! THANKS a LOT!
Really happy you enjoyed it! I got more ^^
I watched your tutorials once and they helped me now i tried to make it on my own and IT WORKED THANK YOU SO MUCH I STARTED LEARNING MULTIPLAYER FROM YOU AND NOW I KNOW SOMETHING FROM MULTIPLAYER
Very happy to help out! :)
bro this is an S-tier tutorial for Fishnet. I just finished watching Episode 2 and came back here to comment, because anyone watching this ought to know that this is a nice little bonfire to start from.
I've been using unity networking tools for about 4 years now. As a self-taught who only really is familiar with C# and a small bit of Unity ECS, I'm thinking fishnet might be a superior solution for implementing game state reconciliation.
also...
>when the capsule is sus
Glad you think so! Appreciate the kind words 🙂
BRA-VO! Yes. more videos like this. walk us through your code, your logic, how-to! fantastic.
Thank you so much! I'll do my best to keep it up :)
@@BobsiTutorial don't burn out though! I watch a video recently of a game dev who got sucked into youtube so much that he burned out. he just wanted to write code, y;know? and ended up running a community and acting as teacher! give yourself some nice boundaries.
@@alyssafaden9443 I see what you mean, and in some way i do feel a little bit of pressure from all the positive feedback. That being said, i honestly feel extremely motivated from the great feedback from everyone, and so far it has only made me more productive :-)
But i'll do my best to watch out. Thank you!
idk why but i was really surprised on how little code you have to write and how smooth it is
another point that sold it for me was that you said i could write code like i was in singleplayer
overall great tutorial, im definitely going to use this tutorial series for my next project
Awesome, glad you like it! Keep us updated :D
Dude you're the goat for fishnet tutorials PLEASE keep them up
Really appreciate the kind words!
oh man! first time in my 2 years of learning unity that multiplayer set up was so easy! thank for the video, you rock for this series c:
Glad to hear!
Nice tutorial man!, really helped me out to understand how to set up fishnet.
Thank you very much!
you got a sub bro! thanks for making this tutorials on youtube are very complex but this one is pretty easy.
Happy to help out! And thank you for subbing. Much love!
Wow really understandable, ill watch your other tutorials for creating menus and stuff
Glad to hear!
Nice quick tutorial on FishNet setup! Since I was starting a new project, I had to pause to get the "single player" movement out of your pasted in code. Otherwise, great info, good pacing, nice editing!
Thank you very much! 😀 Glad you enjoyed it
Man this is very helpful, keep up the good work!
THANK YOU FO9R DOING THIS TUTORIAL,ITS SO SIMPLE THAT I HAVE NO DOUBT THAT ILL FAIL, OI HAVE BEEN STRUGGLING WITH PHOTON AND IM ALWAYS FOLLOWING 9-15 MINUTE TUTORIALS(its just two videos)AND PHOTON WORKS BADLY EVEN AFTER DOING THE SAME STEPS AND FOILLOWING THE VIDEOS ONE BY ONE, THANK YOU FOR THIS TUTORIAL
I AM VERY HAPPY TO HELP OUT! WHY ARE WE WRITING IN ALL CAPS?
@@BobsiTutorial i was just excited :)
@@PrimalEffect2 Haha, that's alright :P
IMPORTANT IMPORTANT IMPORTANT IMPORTANT
* If you receive errors about missing Mirror components,
* such as NetworkIdentity, then remove MIRROR and any other
* MIRROR defines.
* Project Settings -> Player -> Other -> Scripting Define Symbols.
*
* If you are also using my assets add FGG_ASSETS to the defines, and
* then remove it after running this script.
Thanks. This is why i stated that we start with a fresh project ^^
Thats amazing, thanks for the intro! Looking forward to all videos on fishnet, thank you!
Really happy you enjoyed!
thanks. very well explained, I'm not a native English speaker and it was very understandable
Really happy to hear! I am not native English either, so I'm glad it translated well anyways!
THANK U BRO..... FOR THIS WONDERFULL TUTORIAL
Happy to help out! ^^
Thank you so much for this!
Happy to help out!
Thanks, working great in 2024. Just one thing to be aware of is that the player controller seems to default with fishnets player controller script, so you need to remove that component to attach the script you provided.... otherwise the camera doesn't work because it doesn't get assigned.
Yeah they might've added their own script with the same naming. namespaces would fix that easily 🙂
@@BobsiTutorial i get this error
NullReferenceException: Object reference not set to an instance of an object
PlayerController.OnStartClient () (at Assets/Scripts/PlayerController.cs:37
@@Butters_ost Null references are luckily the easiest to fix. You just have to figure out why your reference is null on line 37 of your script 🙂
Best. Video. Ever. Tysm, I thought making my online game would be harder
Really happy to help out!
@@BobsiTutorial keep making this they are amazing!!! just finished integrating this into my first game ever and it worked wonders
@@pollisgaming3168 Hows your game going?
Cool video dude, thanks for the tutorial
Happy to help! :-)
I dont know why i saw this angel so late. You made Multiplayer EZ
Glad you like it! 😀
@@BobsiTutorial like who will not???
Firstly there was an error that i needed to assign a spawnable prefab, and i selected default prefab. Anyways thank you bro
@@CodingCenter1 Yeah, that error started showing an update that came a month or so after the video was uploaded. Luckily it tell people exactly what to do, so most will understand quickly.
Tysm man, your video helped me soo much brother!
Happy to help out! ^^
This is awesome.
Thank you very much ^^ Glad you like it.
This is great content and the netcode is awsome. I made a custom hud, joining and leaving with keypresses and more.
Great to hear!
Amazing
Thank you good sir
Thanks, Man!
No problemo!
ma man changed my nightmare into a dream wtf ??? 😅❤
got you
bro your amazing
Thank you very much 😁
You saved my life!
Glad you like it!
You just gained another sub now...
Thank you very much! ^^
Great video, thank you
Glad you like it! ^^
Omg. Thank you
Happy to help out ^^
Really cool, but will it work with the version of 2019? And with already built world and all?
I don't see why not ^^
KEEP GOING BUDDY GOOD JOB FOR MAKING ME LEAR THIS ALL VERY EASILY❤❤.
Glad you are enjoying 🙂
@@BobsiTutorial but its little bit confusing like i am faceing many errors and dont know to solve like last one when build and run have to do that time error
@@TalkMan. Sounds strange. feel free to join the discord
@@BobsiTutorial not sounds strange as i am to lazy😅😅 and have a very very very best idea in a making a game so ito do that i need some different 3d games and dont know much how to create and because aso need a partner to. I think that you can understand me what my feeling want to say.😁😅🤣🤣
thank you, I forgot to add Network transform and was wondering why players don't move on each other's sreens
Happy to help out 🙂
Hi, I downloaded this resource, and when importing it, a window appeared in which I clicked "Yes". In the "Console" section, I was given \FishNet\Upgrade\Mirror Upgrade.cs(16,7): CS0246: Could not find the type or user name "Mirror" (are you missing the using directive or assembly link?)
Same thing
Try and just delete the MirrorUpgrade.cs. You don't need it.
@@BobsiTutorialOK, thanks
thx man, u helped me!
Glad to hear it!
Thank you!
Happy to help out ^^
Thanks!👍👍
You're welcome
Noice Man love you very very very big
Happy to help ^^
Helpful
Glad to hear! ^^
TYSM☺ YOU REALLY HELPED ME BUT I WANNA ASK IF I CAN PLAY WITH MY FRIEND IF I BUILD THE GAME I MEAN FROM OTHER DEVICES??
Got a video on my channel about how you play with friends. Just pick the multiplayer fishnet playlist, and the video should be in there 🙂
Hey man. I am a Unity Dev who's trying his hand at Networking for the first time. I found Fishnet, and through browsing some resources I found your video. Well done! I have a question for you.
Do you cover server authoritative movement or actions in any of your videos? If not, do you know any written material or videos that does? The Fishnet channel has a video on it, but it's very barebones. Any help is appreciated, I subbed.
Cheers man!
Thank you for the kind words! Very happy to hear that you like the videos.
Unfortunately, i don't have a video or any material on this topic. It is something i looked into very briefly, but it seems to be a different kind of beast.
The best i can recommend is probably playing around with the example that is included in the FishNet examples :-)
@@BobsiTutorial Cheers! Thank you my friend.
HOLY SHIT ITS THE SOULS GUY
Thanks for your great tutorial - I have one question though
How are you able to run 2 instances of the game (like you do on the 6:20 mark) to test the clients?
I build the game so i have a built version and one version still in the unity editor :)
@@BobsiTutorial hey i know i am kinda late but i built and then run the game but the tab still doesn't apear
and thank you for this it helps me a lot!
Glad to hear!
nice totorial thank youu
Happy to help!
could you make a video on how to make a halo or and doom like game with fishnet?
Hmm, probably a bit too specific in terms of games, but a full shooter game series is something that is being worked on for Alteruna ^^ If you are sticking to FishNet, a lot of the logic should apply directly across any networking game.
Great video, help me out ssoooooooo!!! much thank you man
Really happy to hear!
@@BobsiTutorial i got one question though, when i join the game it all works but when i press the space bar it dose not make me jump, instead it say that the camera is no longer active... i think this is because when the space bar is pressed the game thing i pressed the client button and it closes my camera. do you know how i could fix this?
@@brickworkproductions2849 This is only an issue in the unity editor. Just click the screen after you started playing before pressing space bar 🙂
Unity remembers the last button you pressed and will press it again when you click spacebar. So simply just click anywhere else in the game view after starting.
@@BobsiTutorial oh shoot you are right, thanks for the help and sorry for wasting your time
@@brickworkproductions2849 No worries! Happy to help out 🙂
The Player looks kinda sus
yea it look among us charter
5:00 amogus
sus
hey! Great video. How can we get this to work via separate computers? As I have it working on the same PC, but having the server on one computer and the client on a different one doesn't work. Thanks!
You need to add "Tugboat" to the network manager. From there you will see "localhost"
Change that out with an IP on the same network. If it shouldnt be on the same network you will need port forwarding or a tool to connect networks like ZeroTier :-)
@@BobsiTutorial thanks for the quick reply! It goes a long way.
After taking a look at my options I decided to switch to photon👌🏻
@@bblakeyyy @bblakeyyy Which Photon do you use? Keep in mind that PUN is quite old and not very performant at this point. That is why i switched to FishNet in the first place :-) I used to work with PUN
@@BobsiTutorial I used PUN 2. I'm using it for a TH-cam video where there will never be more than 2-3 players in a server at any given time, and will only be active for a day or so while I record. If I was building a game for longevity I would consider my options more, but this is much more temporary :)
@@bblakeyyy If it is just temporary and to play around with, that is just fine. But i noticed alot of things with PUN that was just really slow. In general the networking is just... slow. Network Transforms, RPC calls, etc. Slow. Fishnet is soo much faster with even the primitive stuff. But again, i also started playing around with PUN, and it is good for learning. FishNet is structured practically the same for the un-experienced network user :-)
Hey! Great tut! I know I'm late for this video. I don't know why it does that, but my players aren't syncing at all... Could you help me?
Did you get the network transform on there?
@@BobsiTutorial Oh yeah thanks! You're the only one to mention that, older tuts are not adding it...
thanks
Glad to help out.
hey i wanted to ask you a question, is this networking solution like mirror, where a client acts as a server and other clients join?(and does it support android?)
It can be. When developing, yes. Then it is a Host-Client setup. However, you can also choose to host it on a server, steam servers, unity services, etc. It is really up to you. And yes, it does support phones.
@@BobsiTutorial thank you :)
does fishNet comes with input prediction built in? Thank you so much for the tutorial!
They have prediction yes.
Can I not use the code you used
And thank you very much for your wonderful explanation ❤
You're welcome
Is it possible to create multiple servers? If yes, how? BTW cool video anyway
Absolutely, but it is much more of a general networking question than a FishNet one. It is mostly up to you as the developer. There are a lot to doing such, for example load balancing, server plotting, etc.
Might be interesting for you to look into Alteruna, since they handle the entire server structure for you. They are currently expanding their servers to more regions as well.
@@BobsiTutorial thank you so much for the advice
@@marcelsebek8446 Happy to help out! ^^
Is this only for local network? I mean can a friend across the country join?
I have a video on this on my channel as well, on how you play with friends by connecting your networks ^^
Thank you!
How do I make that checkered material like you did at 2:00? And great tut thanks
It is a default texture in Unity called "Default Checker Grey" or something like that.
@@BobsiTutorial thanks
Hey, it would be great if you could answer.
So im creating an mobile Multiplayer game. Everything is ready and setup, so when i start the server from my main phone and click client on my 2nd phone, the 2nd phone will just not connect.
However, when i then changed the build platform to windows and built the project, it worked.
Do you have an idea, on how to make it also for mobile?
Thanks in advance
I am not sure, I don't develop for phone myself. But I do know it can be used for phone just fine. Maybe try and ask in the FishNet Discord ^^
I imagine it being your setup with a server that might be a bit off.
i have been trying to get multiplayer working but with no success, i tried multiple versions of unity and it always comes up with the same error
The type or namespace name 'Connection' does not exist in the namespace 'FishNet' (are you missing an assembly reference?)
The type or namespace name 'Object' does not exist in the namespace 'FishNet' (are you missing an assembly reference?)
The type or namespace name 'NetworkBehaviour' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'NetworkBehaviour' could not be found (are you missing a using directive or an assembly reference?)
Sounds like Unity doesn't compile the FishNet import correctly, or your IDE doesn't see it properly. It would be either of those really. Tried restarting Unity and your IDE after importing?
And make sure to not initially move the FishNet folders location, as that messes with the assembly
@@BobsiTutorialthanks for the advice and responding do quicky, i have restarted my IDE and restarting my unity and now i have another error on top of that
PlayerCharacterController.cs(145,30): error CS0115: 'PlayerCharacterController.OnStartClient()': no suitable method found to override
i was just wondering if there was something wrong with using unity 2021.3.33f1? since before resetting my pc networkbehaviour still use to worked
edit: i am going to install it on my laptop to see if the pc is the problem
edit: still have the same problem on the laptop as well idk what is causing this. my old projects also now have errors which it didnt have before.
same, no 'Connection' or 'Object' either
Try selecting "DefaultPrefabsObjects.asset" in "Spawnable Prefabs" NetworkManager's "Prefabs" section when you placed the NetworkManager Prefab. It fixed the problem for me
Hey Bobsi, I followed the tutorial and it was great, super easy to follow. However, I do have a question, I did the test where I was able to build it and run it through two instances, however when I wanted to test if it would run through different computers it seemed to not work. How do I fix this, or is Fishnet only for local multiplayer rather than an online multiplayer that I was looking for?
FishNet is very much for online multiplayer. Just depends on your server setup. By default it is set to use localhost, meaning it is purely local.
On the Network Manager you can add the TugBoat component (if it isn't there already)
Here you can see where it says "localhost" and throw in your local IPv4 for both you and another lan computer, and then you'll have working Lan.
I have a video on how you play with friends on my channel for free as well but using this method, but simply connecting your ethernets with a third party tool.
Like
Thank you!
how would I do this with a rigid body player script? im stuck on the ".enabled" thing for a ridged body. Also I need multiple cameras for camera effects.
If you want a rigidbody to work properly over the network, you would have to do some movement prediction. Try and look into a rigidbody example on fishnet. It is a bit more advanced 🙂
but in the end, it should still "only" be the movement script you would want to disable, and not the rigidbody component, if you do it right.
@@BobsiTutorial thanks for the quick reply! I will be looking for TH-cam tutorials!
Thanks for helping!
what setting makes the material on the plane look like a kinda chess board?
Default checkered grey
Hey I have followed this tutorial 3x and I keep running into the same issue.
This seems to be an ownership problem...
Server can move around however when client joins the server changes camera view to the new instantiated client player but still only moves the server player.
Server can't see client move around at all.
Client player can move around and can see server player move around
Used the script provided by your pastebin link without changing anything in it.
followed the creation of the spawn point too
using fishnet pro
not really sure how to fix this issue so if you have any thoughts please let me know so I can try them.
sorry if this comment is doubled up youtube seemed to have deleted my last comment
Hmm, sounds odd. Have you ensured that the ownership check in the beginning of the script is correct? Sounds like something might not be disabling properly for other players, or the network transform isn't where it's supposed to be, possibly.
@@BobsiTutorial After doing some debugging I found the problem was with the main camera??... I have instead added a camera to the player prefab and turn it on if they are the owner instead and this seems to be working fine.
thank you for your help in this even though I am sure you are busy working on Forging Ahead
Bro ur video is amazing, but I have a problem it is saying in the console that the object u want to instantiate is null.
Thank you 🙂
Something tells me that you are missing a reference somewhere? Did you set it up correctly in the inspector? And which script is this error being called from?
add the script to player prefab
so easy!
You know it!
@@BobsiTutorial there is problems in new fishnet version so I shifted to PUN 2
@@Destiny4CODERS What'd the problem? I am using it with no issues.
Hey Bobsi, nice video.
I'm running into an issue which is on most of the tutorials. This only shows LAN multiplayer right?
How can I get this to play a multiplayer game with my buddy across the internet. It really seems like NO tutorial ever covers this and it's quite frustrating. I'm always able to do a LAN test, but my goal is to play with friends across the internet, not in my own house on my same machine. Any way you recommend to do this?
Have you had a look at my channel? I have at least 5 videos going over this, so "NO tutorial ever covers this" sounds incorrect 🙂
@@BobsiTutorial Hi Bobsi! I have, I've looked at a majority of your videos, maybe there's something I'm missing. If you could please link me to all of those, I would love it.
ALL I want to do is make pong or a simple game, and be able to play with my friends online. However they always are only LAN, or require port forwarding. I just want to send a Unity build to my friend over the internet and have him be able to play pong with me. Can you please link me to some videos that will guide me in the right direction towards doing that? I followed your entire pong video completely. Please, I've been looking for weeks.
If it works, I will donate to you, please whatever you need. I just need to play a game with my friend over ONLINE, NOT LAN. not on the same device. different devices, different houses and locations.@@BobsiTutorial
@@FenrirPoker No need to donate. Try and have a loop at the video on PlayFlow 🙂
Hi Bobsi, I took a look at the PlayFlow video twice now. It seems like everything is already set up in this video..
again I'm a bit confused here, so I have to watch the "networking animations video", the "fishnet set up tutorial entire series", and, "connection starter video" for how you set up FishNet? So I need FishNet and PlayFlow together for this? I'd just like a start to finish on how to get this done, but it seems like everything is jumbled up and requires hours of previous set up, which is fine but I just wish to know which all videos would be needed in which orders completely.@@BobsiTutorial
Nice tutorial! I am having one issue though.
When I am ingame the cursor locks and I am not able to click on gui ( cant click server and client buttons since there is the cursor.
Any help?
Try and remove the cursor lock mode code and cursor visibility code.
@@BobsiTutorial Thanks, I'll try it!
Great tutorial! I have a problem though, I cannot run the programme on my oculus quest 2, do you have any idea why that might be? It seems to me like the code is too big and requires too much computational power, infact when I run the apk app on the oculus at first the scene moves as I move my head, then the fans start running and then the app simply shut down before I can even actually enter the virtual workspace.
Thank you for the kind words.
Does it work fine for you if it is not multiplayer setup?
The multiplayer setup should not dictate wether it runs for you or not at all! It is after all "just" a big library, and nothing else. So it absolutely should work for you. Or maybe your computer can't handle it?
no matter what, the multiplayer setup should not have anything to do with it 🙂
@@BobsiTutorial I fixed it and it now runs on my vr. Although, it doesnt run properly: if I click play in unity and just have the game starting in the simulator then one player clone will show. Then if I run the app on the oculus (after installing it through oculus developer hub app for pc) it wont give me the option to choose between server or client, so i changed the code in a way that it runs directly the client option (I commented lines 152-158 and subsituted them with OnClickClient(); )
But still, it doesnt actually show on the editor that a new clone joined, what should I do?
Hello! I know this is an older tutorial but I would still like to ask for help.
So all is fine except from when I go to build the game, upon building I get two errors:
- "CachedNetworkObject" does not contain definition for "SceneName" and no accessible extension method
- "CachedNetworkObject" does not contain definition for "ObjectName" and no accessible extension method
Unsure if this is a common error but so far I have tried restarting Unity, reimporting FishNet and restarting my IDE
Thanks for any help you could give ^^
Hmm, that does sound strange. I think you should try and ask in the FishNet discord, I haven't experienced this, and it sounds like a FN issue
Can you do a video how to make multiplayer with login
It is something i'll look into in the future. Atleast with lobby systems, etc. 🙂
im getting an error with InvalidOperationException to do with my inputs, i looked around and have no idea how to get the controls working
Have you tried restarting your Unity Editor? :-)
hi. great video! but I have a problem. I cant reach to the player controller script from the description. the link does not work for me. is it possible for you to provide a different link? thx
Try with a VPN perhaps. It should work just fine. Still does for me at least.
can this method work on VR project? great project btw !!!
Thank you. I don't see why it wouldn't work. Nothing is different with a VR game from a regular game. Still runs on a PC the same way 🙂
@@BobsiTutorial i mean is there any others setup that i need to do for VR or just same way like in the video ?
@@naufal6560 As mentioned. It still just runs as a regular PC game, so setup should be basically the same. I imagine the head and hands should just be looked at, as the player instead.
would this work for a 2d game or are there 3d calculations happening?
2D Would work just fine.
With Unity, 2D is actually still 3D but with an orthographic camera which just don't see third axis 🙂
@@BobsiTutorial awesome, thank you!
When I try the build the capsules are cubes, and they float in the air at the spawnpoint, and the camera is in the default starting position like in a new unity project
Sounds like your default prefab objects haven't refreshed properly. Go to the FishNet tab at the top and refresh and try again.
Cool video dude thank u very much
Always happy to help!
U forgot to add a part where u basically add "defaultprefabobjects" to the spawnable prefabs, not doing this will not let the game work
It was a standard in the older version, not sure why it isn't anymore, so that is unfortunate. So I didn't forget, it just wasn't an issue at the time of recording.
@@BobsiTutorial okay
Hi how do I make this work over the internet, not on my local device?
I got this video on how to play with friends using software to connect internet: th-cam.com/video/tg_kl2bYdv4/w-d-xo.html
If you want it on a server you have to look into how to do a dedicated server setup which is quite a bit different. Not something i got a guide on 🙂
You could also using something with FishySteamworks which helps connecting fishnet and steam servers. This is also a complicated case if you are new to multiplayer 🙂
@@BobsiTutorial thanks so much I found a hosting sight called playflow which works with fishnet so I will use that but will look at the steam thing cause I'm going to upload my game to steam at some poijt
Can we open the built version as many times as we want to have more than 2 clients?
Yes, you absolutely can 🙂
The scripts are missing for NetworkManager, NetworkSpawner and ObserverManager. Why?
I don't know. They shouldn't be. That is very odd. Try and ask in the FishNet discord server.
Hello, really great tutorial you've made here, you've earned a sub☺️
However, when I click the client button, I get the error "The variable _graphicalObject of Predicted Object has not been assigned." The documentation was too difficult for me, any idea how to fix this?
Thank you very much for the sub and kind words! 😀
I saw another guy in my discord with this issue. I believe he needed to update FishNet, since it was a FishNet version issue. Otherwise a restart of the Unity editor might do it 🙂
Bobsi and your profile pic looks and sounds like a game. Maybe a platformer
Haha, maybe i should make a platformer called Bobsi. How do you see this platformer playing out? ^^
Epic
please tell me did this work for android
It should yes.
Will this work in local area network?
Yes, this is what it is setup to.
If you want to do it with people over the network, you need to port forward or connect your networks 🙂
For some reason it says "Object reference not set to an instance of an object" string 36, so my camera rotation doesn't work at all:( pls help
And the camera also doesn't snap to the player:(
Sounds like multiplayer is a little early for you ;-)
Object reference errors are typically the easiest to solve. Simply means some piece of data which you are trying to grab data from or manipulate doesn't exist (the reference to it, that is)
@BobsiDev the camera does exist though. I tried to put it on the prefab(didn't work), on the scene as a game object(didn't work), make the camera grabbing manual and then dragged it on the prefab(didn't work), put the camera module on the prefab(didn't work). The thing is it worked on the previous player prefab that I accidentally deleted:(
@@BobsiTutorial.
@@DogOnRock Click on your main camera in the scene and set the Tag to the "MainCamera" option
How can you play with friends after the game has been set up? If one clicks Server and the other Client it doesn't work. It does work locally
Lucky for you, a quick check in the FishNet playlist, i have a video on how to play with friends :)
@@BobsiTutorial Oh hahah thank you very much man, I was only just at the second video my bad
What should I do to my code if I have multiple scripts for my player
Just simply convert multiple scripts 🙂In my multiplayer games I can easily have 10+ scripts on a player. It is not an issue. Can actually help you organizing quite well.
Thank you, I’ll join the discord since I’m new unity
Question?
So I can have one player host a game and another player from another console can join player one? Or is this local host only?
You can play with anyone across the world if you set it up for it. This tutorial shows just a local setup. But I have other videos showcasing using zero tier for testing, or dedicated servers for hosting. Or even steams relay (which is free with the steam access)
@@BobsiTutorial thank you!! I will check it out! On my first project and I’m only a few steps away from being able to add this!
hello. i have problem when i use server button all works normally but until i click client after that i can't move camera
ps: i'm using the FPScontroller package from unity 2018.1
So how does the FPS controller grab the camera?
@@BobsiTutorial from camera object
@@ZRD1337 What do you mean "from camera object". Does it use Camera.main? Does it include its own camera? Is the FPS controller package setup to work with multiplayer? There are alot of questions needing to be anwered. I always recommend you start out with making your own basic FPS controller and not using any assets, not even included in Unity. It makes it much better for you to convert to multiplayer, because you need to know what is going on before you can really start modifying it 🙂
what is server host to deploy with fishnet pls?
This is taken from their own Discord, but i think PlayFlow is a good option. I don't have any experience with dedicated servers with fishnet, but maybe go give it a look 🙂
@@BobsiTutorial i tried Playflow. however, it's always connection fail. So bad, i tried lot again again. it does not work :(((((
@@VrainbowStudioGame Don't know much about it. Haven't tried it myself unfortunately.
Finished this video fully and I got the LAN working. however my characters are floating high up off the ground, maybe because the spawn points were set too high? Do they need rigid bodies?
Sounds like the body/graphical object/child is offset
ty, okay I'll try and correct that if possible. going to look for it now@@BobsiTutorial
so if the parent object, the "create empty player" If the parent is at 0, 0, 0, should the child object also be at 0,0,0,?? but then the graphical is inside or UNDER the ground.. so it needs to be offset. no?@@BobsiTutorial
@@FenrirPoker Highly depends. But keep in mind that the coordinates on the child is not world space like it is on the parent. The child coordinates are local space.
local space meaning relative to the parent object? I see. okay I have to do a bit more research on this to have a full and balanced understanding. I'm 2 weeks into unity, so still learning.@@BobsiTutorial
For me when i press play for some reason my mouse in on mouse lock so when i try to press client it just goes back into mouse lock and when i try to build settings and save to assets it says "Building to the Assets folder is not allowed." but you did it in the video so do you know why this is happeing? if not no problem. Love your content btw!
Best thing you can do is to figure out what script in the scene is causing your mouse to lock and fix it from there 🙂
how do i fix the player moving on the opposite different screen like when im on the build screen the one in the ditor moves
You probably didn't disable the other script instances if you are not the owner
@@BobsiTutorial i did but when im in the editor my character in the editor doesnt move but the one in the build does
@@dokong1121 Well if you copied my scripts directly it should work. It does for me. Otherwise it would be a general Unity error perhaps.
Why use the GetComponent().enabled = false? Couldn't you just use enabled = false?
Absolutely! It was really just to make things more clear for people who are not good with existing inheritance and such. But I do that in newer videos.
Hello Bobsi. First, thanks for this tutorial ! I'm a little bothered with the multiplayer because when i click client, every thing seems to work, but when another person clicks client even if he have not my ip, it doesn't work anymore, he takes my perspective and i can't move anymore, i'm at spawnpoint and every functions of my others scripts don't work for him anymore. Can you help me please ?
sounds like an ownership check in the script that is incorrect.