How To Display Profile Pictures & Names - Steam Multiplayer Game in Unity

  Рет қаралды 32,710

Zyger

Zyger

Күн бұрын

In this video I will be showing you how to display members who join your lobby. I will show you how to make this modular so no matter how many people join your lobby will look neat and nice. I will also go over how to display steam usernames and profile pictures and how to get it all setup so no matter who joins and leaves it works. Finally I will show you how to remove users when someone leaves or disconnects.
-----Tutorial Links-----
Previous Tutorial: • How To Make A Steam Mu...
Mirror: assetstore.unity.com/packages...
FizzySteamworks: github.com/Chykary/FizzySteam...
Steam Docs: partner.steamgames.com/doc/home
Source Code: / steam-displaying-61375850
-----My Personal Links-----
Discord: / discord
Instagram: / gabzxd
Twitch: / officialzyger
Twitter: / zygerdesigns
➤WISHLIST MY GAME:
store.steampowered.com/app/16...
//Code Snippet From Video
private Texture2D GetSteamImageAsTexture(int iImage)
{
Texture2D texture = null;
bool isValid = SteamUtils.GetImageSize(iImage, out uint width, out uint height);
if (isValid)
{
byte[] image = new byte[width * height * 4];
isValid = SteamUtils.GetImageRGBA(iImage, image, (int)(width * height * 4));
if (isValid)
{
texture = new Texture2D((int)width, (int)height, TextureFormat.RGBA32, false, true);
texture.LoadRawTextureData(image);
texture.Apply();
}
}
AvatarReceived = true;
return texture;
}
----Time Stamps-----
0:00 - Intro
0:19 - Stage 1 - Setting Up UI & Scene
1:51 - Stage 2 - Prefab and Script Making
3:16 - Stage 3 - Writing Scripts
5:05 - Player Object Controller Script
7:14 - Network Manager Script
8:28 - Player List Item Script
11:02 - Lobby Controller Script
20:57 - Player Object Controller Script
23:47 - Final Editor Changes
24:49 - Testing
25:37 - Outro

Пікірлер: 228
@trix_dev6088
@trix_dev6088 Жыл бұрын
INPORTANT If you are having issues with loading of lobby names or player icons go back and add "CurrentLobbyID = callback.m_ulSteamIDLobby;" at 1:20. Zyger deleted this line and that causes issues. Thanks to Kristan Want for pointing this out.
@ZygerGFX
@ZygerGFX Жыл бұрын
yeah sorry I mentioned this earlier but forgot to pin a comment about it
@DashM670
@DashM670 Жыл бұрын
You literally saved my skin. Thanks so much for pointing this out :):)
@talxongames4919
@talxongames4919 Жыл бұрын
thx dude
@SealStream
@SealStream 4 ай бұрын
I love ya man!!
@ThatGamePerson
@ThatGamePerson 2 жыл бұрын
My biggest suggestion would just be adding a 1 or 2 second pause before jumping sections. At 13.29 basically the exact frame you finish the line of code, it's gone which makes it harder to follow. I know you have to breeze through all this but just that little extra would be a help. I will say otherwise these have been great. I've used Mirror for years and I've stayed away from Steamworks because I always assumed it would be a monumental task. These have made me feel confident to try more things regarding steam. Edit: I realized this has been said below. Sorry!
@user-gm1ty7lk2w
@user-gm1ty7lk2w 2 жыл бұрын
This is intense af and makes brain hurt a bit, but straight to the point thx for such treasure
@Mn7o0s
@Mn7o0s 2 жыл бұрын
Really appreciate your tutorials
@elmajordaan5248
@elmajordaan5248 Жыл бұрын
For those of you struggling with the same thing as I on 20:56 in the player object controller script where non of the override functions Wil work you have to make sure as the to by class, the monnobehaviour should be NetworkBehaviour
@the_original_jake
@the_original_jake Жыл бұрын
life saver, was looking to see if anyone else had issues with this, thank you!
@szaboattila155
@szaboattila155 Жыл бұрын
Been looking for these exact solutions for days on forums. Should started looking for videos right away. This video is top quality and explains mirror better than all of the documentation combined which is not a lot at all. Please unity if you haven't already hired Zyger do it asap.
@TemporalJimi
@TemporalJimi 2 жыл бұрын
Great tutorial, small feedback as it tripped me up a few times, but you have a habit of closing the function/editing a cut elsewhere as soon as you finish a line of code. which is fine and all, i can go back and pause, but since im trying to follow along i need to alt+tab and go back and see what actually just happened. Small criticism, but just a couple of seconds of hang time there would make it easier to follow along! Appreciate u
@ZygerGFX
@ZygerGFX 2 жыл бұрын
Thanks for the feedback. Definitely will try my best not to do that :)
@metramaster
@metramaster 2 жыл бұрын
I fully agree with Jimi here :) -- I spent probably a solid 1-2 hours troubleshooting why my names were not updated correctly on the client, and it was because I missed to call SetPlayerValues() as you show on 18:47, but its only shown there for a few milliseconds before the UpdatePlayerItem method is collapsed. I think just introducing a 1 second pause after a function is completed before it is collapsed would help. On the bright side, my troubleshooting of this issue did help me understand the code flow better :D
@ZygerGFX
@ZygerGFX 2 жыл бұрын
@@metramaster thank you so much for this feedback. Definitely will try to pause after completing a function so that its easier to follow and saves the hassle of trying to figure out what's wrong!
@xyoxus
@xyoxus 2 жыл бұрын
21:58 GetPersonaName returns a string, no need for a ToString at the end. Also it would be super helpful to say which is the "other" script where LocalGamePlayer is used instead of just saying it's in another script. (It's the LobbyController at 15:21) Just some little details.
@gre3k_tv563
@gre3k_tv563 2 жыл бұрын
This was somehow in my algorithm within 30 seconds of upload...not even mad
@HYPERMUSH64
@HYPERMUSH64 2 жыл бұрын
Another banger tutorial, you upload them so fast!
@NaviYT
@NaviYT Жыл бұрын
For this video I reccomend watching at .75x speed. Honestly a lot easier to wrap your head around the subject whilst writing your code with no errors 😄 no hate Zyger, you're just a fast talker. Some people enjoy that :)
@dekirudev
@dekirudev Жыл бұрын
I had a bit of trouble following along because she talks so fast. Thanks for the tip :)
@Orionhart
@Orionhart Жыл бұрын
I've checked the pinned and other comments. Everything functions wonderfully on my end, except I am not getting any textures set for my PlayerIcon rawImage texture. No errors in code or anything. Curious.
@colecancode
@colecancode 2 жыл бұрын
8:25 In CustomNetworkManager, OnServerAddPlayer() takes conn as a paramater, which is of type NetworkConnection. When I do this, it gives me errors saying that there is no suitable method to override, and that it cant convert NetworkConnection to NetworkConnectionToClient. When I change NetworkConnection to NetworkConnectionToClient, I get no errors. Is this ok? Or must it be NetworkConnection, and I'm missing something.
@ZygerGFX
@ZygerGFX 2 жыл бұрын
your just using a different version of mirror I believe. where the methods were slightly changed. i believe that is still fine using the new method name.
@septicwahab4312
@septicwahab4312 2 жыл бұрын
Change OnServerAddPlayer(NetworkConnection conn) to OnServerAddPlayer(NetworkConnectionToClient conn)
@NaviYT
@NaviYT Жыл бұрын
@Septic Wahab ily😭
@Viytek
@Viytek 2 жыл бұрын
I spent all day watching you and I see you writing code or something while you sleep :D
@ZygerGFX
@ZygerGFX 2 жыл бұрын
?
@Viytek
@Viytek 2 жыл бұрын
@@ZygerGFX sorry my english is a bit bad. I watched your videos so many times that I wanted to say that I see them in my dreams
@Viytek
@Viytek 2 жыл бұрын
Also, the steam profile icon is not visible in my game.
@Viytek
@Viytek 2 жыл бұрын
just kidding, never mind
@ZygerGFX
@ZygerGFX 2 жыл бұрын
@@Viytek oh ahaha
@MaxDolotboy
@MaxDolotboy Жыл бұрын
Can someone help me this is half working, the host doesn't get the lobby name and his icon and name doesn't appear in the lobby but when someone join, this person get his own content in the player and can correctly see the lobby name. I only get one error which is "Transport already running as server"
@TripalYT
@TripalYT 2 жыл бұрын
These tutorials are great as, I can't wait to see what else we're gonna learn
@WolfServant
@WolfServant Жыл бұрын
Question, what if we want to return to lobby from game or leave the lobby/close the lobby without it breaking the game?
@rabiehaddad1925
@rabiehaddad1925 Жыл бұрын
The problem is how to spawn the real player when the match started i just have third person shooter game ,and i am wondering is this method works
@Vyrussy
@Vyrussy Жыл бұрын
Why is the Lobby Controller a singleton? It is going to break if you finish a game and return to the lobby, as it loses all references to the UI.
@diegograjales2166
@diegograjales2166 2 жыл бұрын
These tutorials are just too great!
@grambino8622
@grambino8622 5 ай бұрын
great video! got everything working except my steam player icon quality is very poor and it resorts to the same color as the raw image. any workarounds?
@mieskeb8095
@mieskeb8095 Жыл бұрын
Hey! I had a question. At 4:10 you create a GamePlayers property with only a getter. How does GamePlayers know where to get its data from? I have been taking for granted that it just works, but right now I am busy refactoring my code and I need to know its functionality
@xcgasparxc
@xcgasparxc 10 ай бұрын
That means that the variable GamePlayers can only be accessed and not assigned by outside classes, the game players then are added to the list with the .Add() method.
@wildwookiee9559
@wildwookiee9559 2 жыл бұрын
"public override void OnServerAddPlayer(NetworkConnection conn)" turns into "public override void OnServerAddPlayer(NetworkConnectionToClient conn)" How do I fix this so that it will work for just NetworkConnection?
@wildwookiee9559
@wildwookiee9559 2 жыл бұрын
This is in the network Manager btw.
@Urhrhfhsusjjd
@Urhrhfhsusjjd 2 жыл бұрын
I have the same problem as well. Wondering how to fix this
@user-kg5cv2uv5h
@user-kg5cv2uv5h 2 жыл бұрын
I am also seeing this issue.
@wizardly
@wizardly 2 жыл бұрын
for anyone wondering this is fine it will work fine like this
@septicwahab4312
@septicwahab4312 2 жыл бұрын
Change OnServerAddPlayer(NetworkConnection conn) to OnServerAddPlayer(NetworkConnectionToClient conn)
@delmtm569
@delmtm569 Жыл бұрын
Hi, i am watching your tutorials because i need to add steam on my game already with mirror but i have a question, why players can't be spawn directly from the Network Manager ? Now they don't spawn when i change scene and every network identity component are invisible.
@carlosfdezoliver1420
@carlosfdezoliver1420 5 ай бұрын
Thank you very much for the tutorial, I am having a small problem, when a scene takes a while to load the images are always the same as the player (server), when the scene loads quickly the server/client images do appear fine, Would you know what could be the reason?
@Redping32
@Redping32 9 ай бұрын
Hi I'm Korean and your videos are really helping me a lot, thank you! I was wondering how you learn to make tutorials or how you find the resources you refer to. I'm too dependent on other people's tutorials. I'm looking for a way to make programs that I can think of on my own. Any advice would be appreciated!
@FedeRzVz
@FedeRzVz Жыл бұрын
What an amazing tutorial Zyger, I think that I followed all the steps and it works almost 100%, It happens to me that when creating a Lobby, it works, but 2 lobbies are shown, the default lobby that was created with canvas is maintained and then as a second one lobbyItem that I created with my name and Steam logo appears, that is, 2 lobbies appear (The default and mine), why the default lobby are shown?
@h1tman_
@h1tman_ 2 жыл бұрын
My game crashes, whenever i hit host. The reason might be the player object controller as when i make the player object controller null(in custom network manager), it loads rather then crashing but the pfp and name dont load. It couldn't be a coding problem as i coded this FIVE TIMES! i removed the lobby controller from lobby scene it loads but still that problem
@IMsTRACH
@IMsTRACH Жыл бұрын
I had the same or similar problem. I made a typo in LobbyController script, CreateHostPlayerItem() function, the foreach condition has to use the Manager with capital M, not the lowercase one.
@skygge1136
@skygge1136 Жыл бұрын
@@IMsTRACH you saved life
@rubirubig3944
@rubirubig3944 10 ай бұрын
How can I fix this error? CustomNetworkManager.cs(14,26): error CS0115: 'CustomNetworkManager.OnServerAddPlayer(NetworkConnection)': no suitable method found to override
@themoni2761
@themoni2761 8 ай бұрын
Can someone help me? So the issue i have right now is that when the Host hosts a game he joins the lobby and his player item is added and is visible by the client and the host. But when a client joins his item is not created so neither the host or the client can see it. I have put the "CurrentLobbyID = callback.m_ulSteamIDLobby;". And my game is not published on steam so im using the default Spacewar 480 ID. Any help is appriciated! Sorry if i have mistakes in my writing but English is not my first language. EDIT: They are overlapping so i just messed up some setting
@zephthegamer8635
@zephthegamer8635 Жыл бұрын
WTF, in Lobby controller and in player list item script they arent showing up with any fields!!! HELP PLEASE
@auraa8015
@auraa8015 Жыл бұрын
mine not working and i have no errors and the player names and prfiles arent showing up
@g1zeuz
@g1zeuz Ай бұрын
I did everything as in the video, but when I press the "Host Game" button after starting the game in the Unity editor, the Unity editor closes. Can you help me?
@CreativelyBad
@CreativelyBad 10 ай бұрын
Not sure why but when I add a client to the lobby list the name is being set. this only happens on the client cause the clients name is showing up on the server. anyone know how to fix?
@snipwilder6717
@snipwilder6717 2 жыл бұрын
Hey, thanks for this tutorial. I'm still trying to get it to work and wanted clarity at 1:22. Do we delete all of that? Because I'm not able to see my own icon and the lobby name is missing if I delete "CurrentLobbyID = callback.m_ulSteamIDLobby;". I'm also trying to figure out why friends aren't able to see the same lobby as I do when they join. I'm looking into it but any pointers would be great! Thanks
@snipwilder6717
@snipwilder6717 2 жыл бұрын
Fixed the issue, I forgot to replace the default Steam App ID with the ID for my game.
@serefcaliskan4865
@serefcaliskan4865 2 жыл бұрын
I was having the same problem, I solved it thanks to you. Thank you. "CurrentLobbyID = callback.m_ulSteamIDLobby;" Do not delete your code. :)
@snipwilder6717
@snipwilder6717 2 жыл бұрын
@@serefcaliskan4865 👍
@rabiehaddad1925
@rabiehaddad1925 Жыл бұрын
I made a join button but its not working will what kind od script need to be on the join button
@cedriclaps
@cedriclaps 8 ай бұрын
Pls help my override function OnStartAuthority is not passing. So the function never runs
@regalmarmot4833
@regalmarmot4833 Жыл бұрын
Hi! I was wondering because this doesnt work for me and i wanted to join the patreon do i get the actual project or just the scripts?
@MaxDolotboy
@MaxDolotboy Жыл бұрын
What's not working for you we might have the same problem
@BaroBeans69
@BaroBeans69 3 ай бұрын
for some reason when i click host lobby i see 3 player list items and its all me, how can i fix this?
@doccampbell2006
@doccampbell2006 2 жыл бұрын
Do you know if mirror is available for any other game engine or is it a unity exclusive? I don’t use Unity but 9/10 times the same concepts can be used in my engine without to much difficulty
@ZygerGFX
@ZygerGFX 2 жыл бұрын
Well mirror is built upon the old Unity net code. SO probably not. They basically took the old untiy multiplayer stuff and kept working on it and improved it. So my guess is no but dont 100% quote me.
@pb3dpb3d
@pb3dpb3d 2 жыл бұрын
Steam distributes dll files that you can link to and call functions provided in it.
@ZygerGFX
@ZygerGFX 2 жыл бұрын
@@pb3dpb3d yes steam api can be used on virtually on anything but I think mirror is unity only.
@pb3dpb3d
@pb3dpb3d 2 жыл бұрын
@@ZygerGFX yeah mirror is made on UNet HLAPI as the compatible alternative to it, so yes - it is unity specific.
@koferperk
@koferperk Жыл бұрын
I need help. The build only works when there is a file "steam_appid.txt" in the same directory. But how does that work since when I build the game it does not bring the steamappid.txt integrated into it so when using that build on another computer it does not work when clicking start host unless manually putting a steamappid.txt in the same directory as the app. What do I do? and if I were to push out a game onto steam and get my own steamID, will this issue stay the same or go away?
@ZygerGFX
@ZygerGFX Жыл бұрын
It should automatically create it. If not make it yourself. Thankfully once you make it once and keep it in the build folder it will stay there. Once you get your own appid you can change it in unity. Hopefully that will fix itself and generate it for you. If not you have to make it yourself and replace the default 480 in the text file with yours. But as I said you only need to make the file once. Also this is a known bug and only happens to a few people
@malfagafo
@malfagafo Жыл бұрын
Thank you so much for your comment. I was getting crazy trying to figure out why I couldn't start the host game when I opened via .exe. I simply copied the steamappid.txt and it worked.
@willcroft5105
@willcroft5105 Жыл бұрын
Can one somewhat reuse this and other videos in the series with the new Netcode and facepunch steamworks? Would much have to change to the code? If you could provide some advice/examples, that would be awesome. Cheers.
@ZygerGFX
@ZygerGFX Жыл бұрын
Unfortunately this uses mirror and facepunch is entirely different. They do have a documentation on facepunch and some examples on github though
@user-ih2dd5rd8b
@user-ih2dd5rd8b Жыл бұрын
I can't check Callback function for Debuging in Editor. So, Is it impossible in Editor? And, I can't check // SteamLobby component // - function if (NetworkServer.active) return; manager.networkAddress = SteamMatchmaking.GetLobbyData (new CSteamID(p_Callback.m_ulSteamIDLobby), HostAddressKey); manager.StartClient(); When it is useful? I can't understand. sorry. TT
@pepper.
@pepper. Жыл бұрын
Anyone struggling with the override issue in the CustomNetworkManager change 'NetworkConnection' to 'NetworkConnectionToClient'
@danielhuang6668
@danielhuang6668 Жыл бұрын
thanks bro
@lukakvlogs1478
@lukakvlogs1478 2 жыл бұрын
Im sorry but I cant seem to find the "GetSteamImageAsTexture" code:( if anyone know where to find it please tell me:)
@ZygerGFX
@ZygerGFX 2 жыл бұрын
sorry about that just realised that its not in the description. ive gone ahead and added it
@cyrubix328
@cyrubix328 9 ай бұрын
I followed this tutorial but the scene isn't switching when I click the host button.
@cloudie9450
@cloudie9450 Жыл бұрын
When i type this line 15:40 i get this error "error CS0428: Cannot convert method group 'GetComponent' to non-delegate type 'PlayerObjectController'. Did you intend to invoke the method?"
@cloudie9450
@cloudie9450 Жыл бұрын
I fixed it sry. I just had to add "()" at the end.
@ALeUnus
@ALeUnus 2 ай бұрын
@@cloudie9450 thank you very much man
@kilogram_o7204
@kilogram_o7204 Жыл бұрын
17:37 make sure you add the "!", i spent 2 days trying to figure out why my lobby controller wasn't working
@voodookittoys7606
@voodookittoys7606 Жыл бұрын
Thaaannkkk you I had the same problem and couldnt figure it out the whole day
@RealUtku
@RealUtku Жыл бұрын
Hi i have a problem i write all script but it says in customnetworkmanager it says Assets\Scripts\CustomNetworkManager.cs(14,26): error CS0115: 'CustomNetworkManager.OnServerAddPlayer(NetworkConnection)': no suitable method found to override
@minecraftmaniacawesome3857
@minecraftmaniacawesome3857 Жыл бұрын
Hey, just in case you haven't figured it out yet, the method's name is the same but it's dependency has a different name just put this in it's place OnServerAddPlayer(NetworkConnectionToClient conn)
@gabrielmendesmatos5121
@gabrielmendesmatos5121 2 жыл бұрын
Thanks for the video! Is it possible to test this with multiple steam accounts without having a second pc?
@sandwich7424
@sandwich7424 Жыл бұрын
virtual machine
@2unleash
@2unleash 4 ай бұрын
my script crashes when calling any Texture2D constructor, i have tried almost all combinations... I haven't been able to find a solution - any one any idea?
@theexiledone5742
@theexiledone5742 Жыл бұрын
First of all, thank you for your great tutorials. Found no one else who does it that good and in depth. But I am encountering one problem: In Unity everything works perfectly fine. I press Host, my Icon l+ name is shown, and I can ready Up and start. But as soon as I build the game and start the game via .exe and via steam, the "host" Icon just isnt there. Is there any explanation for that? I looked it up now for several hours, but didnt find any solutions... Is it because of the Steam ID? It should be for testing on steam 480, right? Thanks in advance :)
@theexiledone5742
@theexiledone5742 Жыл бұрын
I figured it out. Other UI-Elements were just blocking it... But now my Movement in multiplayer is a problem.
@coolorphans
@coolorphans Жыл бұрын
I have a similar problem. I build the project and download the build on my other computer with a different steam account but I can't join the other steam account.
@channeltrash6257
@channeltrash6257 Жыл бұрын
PlayerListItem not spawned. GamePlayers count = 0.... where did i might wrong
@kristianwant6775
@kristianwant6775 2 жыл бұрын
Super nice tutorial! I've managed to get it working when i launch it in unity (bar the profile picture is always white, but i can work on that..), however the button to create a lobby doesn't work when i run it through steam. Do you know what could be causing this difference? All the best!
@ZygerGFX
@ZygerGFX 2 жыл бұрын
do you set the current lobby id inside of the update lobby name ? this would probably fix your profile pictures and might be the reason why its not working in steam.
@kristianwant6775
@kristianwant6775 2 жыл бұрын
@@ZygerGFX Thanks for your swift reply! Wowzas that was an adventure to try and get it working again - you pushed me in the right direction. Turns out that keeping the line you said to delete at 1:20 (CurrentLobbyID = callback.m_ulSteamIDLobby;') fixed everything. Although this has left me a little confused, should I have removed the 4 lines of code or should I have kept them?
@ZygerGFX
@ZygerGFX 2 жыл бұрын
@@kristianwant6775 ah thank you for pointing it out to me. I was actually only meant to delete 3 lines of code so excluding the current lobby ID. sorry for the issues all my fault
@ozmega
@ozmega 2 жыл бұрын
@@kristianwant6775 holy shit i was about to go thru the same rabbit hole, thx
@kristianwant6775
@kristianwant6775 2 жыл бұрын
@@ozmega glad I helped! Wish someone had worked it out before me too haha
@isntityoshi5657
@isntityoshi5657 2 жыл бұрын
i cant see profile pictures?
@HighOnQuack.
@HighOnQuack. 2 жыл бұрын
When I press host the lobby name is black and the name for py steam account is LocalGamePlayer, any idea where i've gone wrong?
@ZygerGFX
@ZygerGFX 2 жыл бұрын
I recommend going over the tutorial and checking that your code is exactly the same. if this doesn't fix anything then join my discord ( link in the description) where I will be able to help you more ! :)
@EnchikO
@EnchikO 2 жыл бұрын
I can't test it, because when i send request to my friend or he wants to join, it automatically starts Spacewar (some game about space ships in space). How can I tell Steam, that game, I want to join is that I add as non-steam game.
@ZygerGFX
@ZygerGFX 2 жыл бұрын
as mentioned in video 1. if you use the defualt APP ID the game will be called spacewar. But as long as both of you have added the game into your steam library and launched it through there it should work fine.
@EnchikO
@EnchikO 2 жыл бұрын
@@ZygerGFX Yes, thank you. Problem was that we both added game to steam library but my friend didnt launch it (i just send him a invite) so it starts the Spacewar game.
@masterx82
@masterx82 6 ай бұрын
Who edited this video?
@Implicitz
@Implicitz Жыл бұрын
Hi Zyger, I really need help with this error. Assets\Scripts\Online\CustomNetworkManager.cs(15,26): error CS0115: 'CustomNetworkManager.OnServerAddPlayer(NetworkConnection)': no suitable method found to override
@ZygerGFX
@ZygerGFX Жыл бұрын
the name of the function changed. go into the original mirror script and chekc the new name. make sure you override the func with that name and its references.
@minecraftmaniacawesome3857
@minecraftmaniacawesome3857 Жыл бұрын
Hey, just if you haven't figured this out yet or if someone else needs help on the same topic, the method is named the same but the name of the variable has changed. The new method is called: OnServerAddPlayer(NetworkConnectionToClient conn)
@artymer5021
@artymer5021 Жыл бұрын
EDIT: I was missing a line in the "OnLobbyCreated" function. The line was "manager.StartHost()." Quite a crucial line to miss haha Hi there. I'm having a few issues I couldn't find in the comments and have yet to find anything on my deep dive into Google. When I click the Host button in the editor the lobby is successfully created but the scene doesn't change from MainMenu to Lobby even though I've specified those scenes like the tutorial. Another issue I have is that the lobby still times out after the specified amount of time (25 seconds) even though the lobby is successfully created. I'd appreciate any help. Thanks.
@CRAITIFT
@CRAITIFT Жыл бұрын
Great tutorial, I just have one issue... I can't seem to find where you code the scene change from Main Menu to Lobby. When I run the game and click the Host button, it doesn't switch over to the Lobby scene. Is this just a simple "LoadScene" fix? If so, how would I get other clients to load into that same scene?
@CRAITIFT
@CRAITIFT Жыл бұрын
Nevermind, It started working now... not quite sure what fixed it though, but most likely a problem on my end.
@ZygerGFX
@ZygerGFX Жыл бұрын
@@CRAITIFT On the network manager where you supply the offline and online scene that is where the scene switch happens. That particular function is already built in the network manager. Glad its fixed btw :))
@trix_dev6088
@trix_dev6088 Жыл бұрын
Hey, I am having some issues with the PlayerObjectController script. First I cannot overload functions OnStartAuthority, OnStartClient or OnStopClient, and they are missing any references(they are never called). Second isServer and isClient are not recognized. My first thought was that i was missing an assembly reference as both of these are default variables/functions in mirror, but I think I have all the necessary assembly references. If anyone can help/offer ideas that would be great! attached is my assembly references. using System.Collections; using System.Collections.Generic; using UnityEngine; using Mirror; using Steamworks; using Mirror.FizzySteam;
@simplisticgames2036
@simplisticgames2036 Жыл бұрын
Did you change the code from: public class PlayerObjectController : MonoBehaviour . To: public class PlayerObjectController : NetworkBehaviour
@trix_dev6088
@trix_dev6088 Жыл бұрын
@@simplisticgames2036 No I did not! Thank you so much for the help! You just saved me lots of time!
@m3k4studio25
@m3k4studio25 Жыл бұрын
Hello Zyger, Thanks your tutorials first. i host the game to lobby then can show the icon, but can't show the name. i check many time but can't find what happen. i want to ask the in the script of the PlayerListItem public void SetPlayerValues() { PlayerNameText.text = PlayerName; if (!AvatarReceived) { GetPlayerIcon(); } } Which one script is setting the "PlayerName" Many many thanks!!
@skygge1136
@skygge1136 Жыл бұрын
did you solve it?
@theconfusedllama
@theconfusedllama 4 ай бұрын
@@skygge1136 hope that helped ^
@theconfusedllama
@theconfusedllama 4 ай бұрын
Seeing as YT keeps deleting my comment about the code, third time: CustomNetworkManager.cs > under where you assign PlayerSteamID: GamePlayerInstance.PlayerName = SteamFriends.GetFriendPersonaName((CSteamID)GamePlayerInstance.PlayerSteamID);
@RuneOracle
@RuneOracle 11 ай бұрын
I had everything working great, went onto your movement tutorial, things were still working great, and now all of a sudden the clients don't properly connect to the server/see the correct info on the lobby screen. Send help. lmao Even when loading into the Game, the host can see the client, and both move around, but the client does not see the host anymore....
@hammyham
@hammyham 8 ай бұрын
can anyone help me? Everything works fine in the unity editor I can connect and everything. But when I try building it and try adding it as a non steam game to my library and running it it the host button doesn't do anything. can someone help? thanks!
@ZygerGFX
@ZygerGFX 8 ай бұрын
hey, so you need to ensure that in your build folder you have a txt file called "steam_appid" where you have the appID of your game written on the first line. So if you're using the default one that would be 480. Normally the compiler should create this file for you, which is why i didn't mention it. But it seems like that is not always the case
@hammyham
@hammyham 8 ай бұрын
@@ZygerGFX thanks for the quick reply lol. this worked and im back in business tysm!
@firefoxiyt1516
@firefoxiyt1516 5 ай бұрын
HELP :( i have a bug in my code for the Host its only loading his data to every player that joins, for the client no profiles are getting loaded. Someone got a idea?
@user-ix8qj8wz8x
@user-ix8qj8wz8x 4 ай бұрын
I havev the same bug, have you found any solution?
@danbe9835
@danbe9835 2 жыл бұрын
i went trough the video now 2 times. everytime i press play and host lobby unity starts loading for 3secs~ and then just crashes without an error message. anybody can help?
@GougeO
@GougeO 2 жыл бұрын
Same, I've gone through the video twice trying to see if a mistake was made. In fact both the app and Unity crashes. If I uncheck "Auto Create Player" it doesn't crash, but doesn't work properly either. I used latest Mirror with FizzySteamworks 4.4.1. Has anyone else encountered and resolved this?
@mikkelsrensen3176
@mikkelsrensen3176 2 жыл бұрын
@@GougeO Happens to me too, Did you ever find a fix?
@TMMarkus_
@TMMarkus_ Жыл бұрын
Make sure you write "UpdatePlayerItem()" instead of "UpdatePlayerList()" on the line "if (PlayerListItems.Count == Manager.GamePlayers.Count)" in LobbyController. This was my solution, because if you wrote "UpdatePlayerList()" it causes an infinite loop and Unity crash.
@nikbox609
@nikbox609 Жыл бұрын
Dont know why but my Icons dont load
@justinsijbolts
@justinsijbolts Жыл бұрын
Same, just stays white
@colecancode
@colecancode 2 жыл бұрын
How would I change the GetPlayerIcon() method in the PlayerListItem script so that it works with ANYONE, not just steam friends? I ask because the lobbies I plan on making are public, so the "int ImageID = SteamFriends.GetLargeFriendAvatar((CSteamID)PlayerSteamID);" line wouldn't work for people not in the players friends list.
@larsmaas07
@larsmaas07 2 жыл бұрын
shrek
@xxtremestudio
@xxtremestudio Жыл бұрын
Hey Cole, Did you ever find out the answer to your question? Im trying to make mine public as well
@FedeRzVz
@FedeRzVz Жыл бұрын
@@xxtremestudio Hello, did you find out something?? Im trying to make it public too
@xxtremestudio
@xxtremestudio Жыл бұрын
@@FedeRzVz You just change whatever she puts down for the friends list to public, it should be shown when you start writing the thingy hehe
@FedeRzVz
@FedeRzVz Жыл бұрын
@@xxtremestudio that simple? So I replace every function that says "friend" with its alternative to "public" and it should work? It sounds very easy but hey, I'll try it there. thank you very much bro
@kayo_tv
@kayo_tv Жыл бұрын
hello, i have an issue... when i run the game in my project all is fine but when i build and run it, the host bouton just make nothing (also in steam). Can you help me pls ?
@ZygerGFX
@ZygerGFX Жыл бұрын
does your build folder have a textile called steam_appid.txt ? if not you need to create one and write the app id which should be 480 unless you're using a custom one.
@kayo_tv
@kayo_tv Жыл бұрын
@@ZygerGFX Hi! I already have a steam_appid.txt in my PROJECT folder but not in the BUILD folder. I will try… Thanks for the help :)
@Keroyz
@Keroyz Жыл бұрын
hello Zyger, im having this problem in unity "Disconnecting connId=0 to prevent exploits from an Exception in MessageHandler: NullReferenceException Object reference not set to an instance of an object at LobbyController.CreateHostPlayerItem () [0x00000] in C:\Users\dante\Downloads\Ghost House BETA\Ghosthouse\Assets\LobbyController.cs:72 " do you know how I could fix this? The line in LobbyController in 72 is: "foreach (PlayerObjectController player in Manager.GamePlayers)" EDIT: Nvm fixed it, it was an incorrect operand usage. I had it as "if (Instance == null) {Instance = (this)" when it should have been "if (Instance != null) {Instance = (this)"
@berkeerdeniz9373
@berkeerdeniz9373 6 ай бұрын
private void Awake() { if (Instance != null && Instance != this) { Destroy(gameObject); } else { Instance = this; DontDestroyOnLoad(gameObject); PlayerListItems = new List(); } }
@zachbyron4012
@zachbyron4012 Жыл бұрын
Im getting a null reference when trying to call Lobby controller for just "LobbyController.Instance.etc" in the PlayerObjectController, I noticed its not referenced ealier in the script
@zachbyron4012
@zachbyron4012 Жыл бұрын
I had my awake function in lowercase. tldr im a dingus
@chair4099
@chair4099 Жыл бұрын
@@zachbyron4012 explain because I've been trying to find the instance for ever in the steam lobby video
@zachbyron4012
@zachbyron4012 Жыл бұрын
@@chair4099 the only instance is the game network manager reference made in the player object controller script. Apparently you don’t need a reference to the lobby controller, just using the methods in the video seem to work fine for me.
@jesuslover8541
@jesuslover8541 Жыл бұрын
the code is good no erorrs but the image is not showing how to fix this
@ZygerGFX
@ZygerGFX Жыл бұрын
Check the pinned comment :) hope it helps
@LinesStudio55
@LinesStudio55 9 ай бұрын
In lobby, i dont see my avatar and name, and lobby name doesn't changed, what can i do? Edit: i have found, that NetworkServer.Active isn't active when i launch a game
@ZygerGFX
@ZygerGFX 9 ай бұрын
Look at the pinned comment but also go back to 1:20 and add this line: CurrentLobbyID = callback.m_ulSteamIDLobby; that I accidentally removed.
@LinesStudio55
@LinesStudio55 9 ай бұрын
@@ZygerGFX thanks for your answer, but i have already returned it)
@LinesStudio55
@LinesStudio55 9 ай бұрын
@@ZygerGFX And i noticed, that in in unity, when i start game, at the up-left corner of the screen appears "Snapshot-interp" HUD, i dont see it in video, what is that? Maybe it causes the problem?
@joaotarik6328
@joaotarik6328 6 ай бұрын
I make all correctly, but when i go hit play on mainmenu, it starts the scene but Name of the lobby doesn't show, Player List not work, nothing works, i tried to see if is creating a lobby, but connection id is 0.... helppp
@ZygerGFX
@ZygerGFX 6 ай бұрын
2 fixes i can think of. 1st one check pinned comment. second fix is make sure that your game folder has a text file called "steam_appid" and make the first line of the text file the app id so either 480 or your custom one.
@joaotarik6328
@joaotarik6328 6 ай бұрын
​@@ZygerGFX Hi, sorry for late response... I've already done what the first comment says and it was already 480 in the file and it's still not working
@Gguniform14
@Gguniform14 2 жыл бұрын
What kind of computer would I need to download Unity
@ZygerGFX
@ZygerGFX 2 жыл бұрын
i mean not sure .it doesn't have to be too good. maybe google it
@Gguniform14
@Gguniform14 2 жыл бұрын
@@ZygerGFX ok Thank you anyway
@Disisameme
@Disisameme 5 ай бұрын
Looks like it doesnt work with the newest version of the network manager because you dont have the option with the sceneswitch anymore. Another tutorial series of mirror x steam multiplayer in 2024 would be cool
@ZygerGFX
@ZygerGFX 3 ай бұрын
Hey the function doesn't exist in the network manager but you can go into the old version of mirror where it does exist and see how they do the scene switch. Then simply copy that and implement it in again.
@azart23301
@azart23301 3 ай бұрын
my name player not add but avatar is work , what is problem?
@ZygerGFX
@ZygerGFX 3 ай бұрын
Hey please check the pinned comment. If that doesn't work please double check your code and that its the same as the video!
@NotPalliot
@NotPalliot 2 жыл бұрын
So I've come to a point where none of the override voids work in this tutorial, not in the NetworkManager script, nor the PlayerObjectController Script. I've looked through the tutorial for hours, and I believe I have it word for word. Is it possible the tutorial is a little bit outdated? I understand it is very possible I just got something wrong, as I am not used to writing code. Thanks!
@ZygerGFX
@ZygerGFX 2 жыл бұрын
Hi, The newer version of mirror changes function names so the override method won't be called the same. Try see what the new methods and called and override those.
@kilogram_o7204
@kilogram_o7204 Жыл бұрын
@@ZygerGFX hi do you know what the new method names are?
@MaxDolotboy
@MaxDolotboy Жыл бұрын
@@kilogram_o7204 Did you get the infos ?
@justinbena6392
@justinbena6392 4 ай бұрын
did you fixx
@Tanicorn
@Tanicorn Жыл бұрын
I love you
@Spooky_Josh
@Spooky_Josh 2 жыл бұрын
My icons are transparent and are dull.
@evbishop9011
@evbishop9011 Жыл бұрын
I had the same issue, you're probably using texture = new Texture2D((int)width, (int)height, TextureFormat.ARGB32, false, true); instead of texture = new Texture2D((int)width, (int)height, TextureFormat.RGBA32, false, true);
@Keroyz
@Keroyz Жыл бұрын
Everyone if you're having some bugs after following the whole tutorial I recommend that you re-watch the tutorial comparing the scripts to see what might be wrong in yours, I did that and it fixed pretty much everything, al though if you are experiencing a few issues comment below and I'll try to help
@MaxDolotboy
@MaxDolotboy Жыл бұрын
That's what I did and everything is the same but it's still half working, the host doesn't get the lobby name and his icon and name doesn't appear in the lobby but when someone join, this person get his own content in the player and can correctly see the lobby name. I only get one error which is "Transport already running as server"
@nilsleonhardtdev
@nilsleonhardtdev Жыл бұрын
@@MaxDolotboy did you fix the error?
@MaxDolotboy
@MaxDolotboy Жыл бұрын
@HALİL ERKMEN I used something on the Unity Asset Store, pre-made steam multiplayer lobby system with Mirror. I think that what causes this problem is the Mirror version not being the right one for the the rest. With the asset I am talking, everything is perfectly fitting. Its free, but I dont remember the name
@33Cerberus
@33Cerberus Жыл бұрын
My player icons is so brightness, what I must to do?
@GosoeGoose
@GosoeGoose 9 ай бұрын
Did you get a fix for this?
@WheremyPoptart
@WheremyPoptart Жыл бұрын
In your CustomNetworkManager script, make sure you put the correct scene name for the lobby.
@AssasinSniperman
@AssasinSniperman Жыл бұрын
Thanks Bro
@mr_floax
@mr_floax 2 жыл бұрын
I dont use unity but good tutorial
@frosty7674
@frosty7674 2 жыл бұрын
If only i used Unity these videos would have been more than just being awesome.
@scryptol16
@scryptol16 7 ай бұрын
good tutorial but slow down omd
@hugofrogboywithstuff
@hugofrogboywithstuff 2 жыл бұрын
Could you make a video about game maker 2? (I wanna use it and I don't want to use unity)
@ZygerGFX
@ZygerGFX 2 жыл бұрын
sorry but no. i dont own game maker and dont use it anymore
@robertsharp2633
@robertsharp2633 Жыл бұрын
20:50
@OhJustinYT
@OhJustinYT 10 ай бұрын
7:14
@OhJustinYT
@OhJustinYT 10 ай бұрын
10:36
@matiasgabrielarellanosanch5776
@matiasgabrielarellanosanch5776 3 ай бұрын
10:6
@EMPERENIKA
@EMPERENIKA Жыл бұрын
Spaghetti code
@ZygerGFX
@ZygerGFX Жыл бұрын
what parts exactly? I'd love to improve my code so let me know what parts you think could be better :)
@user-kh2xr2nl5s
@user-kh2xr2nl5s 2 жыл бұрын
I like you. Can you work on a game with me
@ZygerGFX
@ZygerGFX 2 жыл бұрын
thank you. but no sorry I have my own projects that I'm working on.
@christian7865
@christian7865 2 жыл бұрын
This seems fun to create, destroy your social life, stop touching grass and start talking in C#... kinda easy ;)
@serefcaliskan4865
@serefcaliskan4865 2 жыл бұрын
I made 20+ typos because I was so careless. Ahahahahah.
@jesuslover8541
@jesuslover8541 Жыл бұрын
bool isVaild = SteamUtils.GetImageSize(iImage, out uint width , out uint height); got an error .GetSteamImageAsTexture(int)': not all code paths return a value
@t0xangames207
@t0xangames207 Жыл бұрын
When I connect to the lobby, nothing changes on the lobby scene, and 2 errors appear pointing to the LocalGamePlayer object. One of the mistakes: NullReferenceException: Object reference not set to an instance of an object T0xanGames.Multiplayer.LobbyController.UpdateLobbyName() (at Assets/T0xan Games/Scripts/_Mirror/Lobby Controller.cs:52) T0xanGames.Multiplayer.PlayerObjectController.OnStartAuthority () (at Assets/T0xan Games/Scripts/_Mirror/PlayerObjectController.cs:36) the first one points to the string: CurrentLobbyID = GetComponent().CurrentLobbyID; in the UpdateLobbyName method of the LobbyController class, and the second to call this method in the OnStartAuthority method of the Player Object Controller class. It will be good if you can help me fix this also, the ConnectionId value of LocalGamePlayer = 0
@sangotwtom5
@sangotwtom5 Жыл бұрын
I guess you are using TMP text, like in my case. Changing to the other object loading method (or back to the old text UI) can fix this. see StackOverflow "Unity TextMeshProUGUI.text is NullReferenceException"
@t0xangames207
@t0xangames207 Жыл бұрын
@@sangotwtom5 I have been working at Unity for 3 years. And I know perfectly well that TMPro and regular UI Text are different things. I use plain text because it's simpler
@t0xangames207
@t0xangames207 Жыл бұрын
@@sangotwtom5 Moreover, the errors do not point to LobbyController, but to LocalPlayerObject , which does not have text fields
@sebbie7132
@sebbie7132 2 жыл бұрын
Hi Why do i keep getting this Erorr Assets\CustomNetworkManager.cs(14,26): error CS0115: 'CustomNetworkManager.OnServerAddPlayer(NetworkConnection)': no suitable method found to override in customnetworkmanager
@ZygerGFX
@ZygerGFX 2 жыл бұрын
make sure that your script is inheriting from the network manager. if you are still getting the issue it might be because you are using a newer version of mirror where the function has slightly been changed and renamed. so locate the add player/spawn player function in the network manager as see what tis called and what it takes, and then override that one.
@septicwahab4312
@septicwahab4312 2 жыл бұрын
Change OnServerAddPlayer(NetworkConnection conn) to OnServerAddPlayer(NetworkConnectionToClient conn)
@thepancakeexpert
@thepancakeexpert 3 ай бұрын
Hi Zyger. So my player object controller works as intended, it gets the right steam name. However the player list item does not. It doesn't produce anything on the client side and only copies the host name for the host. So if there are 2 players it has 2 player list items and both say the host name. Any ideas? I think it has something to do with my lobby controller since thats where we create the player list item and set the values but I'm unsure.
@thepancakeexpert
@thepancakeexpert 3 ай бұрын
UPDATE: The condition for creating a client list player object is not met but on the host it is so I'm assuming the connection ID is off and only syncing with the host. Will troubleshoot here Edit: bro I didn't see that exclamation point, testing now but I feel stupid😂
How I Became a Sea of Thieves Developer
8:05
Zyger
Рет қаралды 154 М.
How much MONEY my Game made (and how much it cost!)
14:00
Code Monkey
Рет қаралды 154 М.
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 3 МЛН
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 33 МЛН
When someone reclines their seat ✈️
00:21
Adam W
Рет қаралды 21 МЛН
I tried coding my own graphics engine
4:23
Garbaj
Рет қаралды 184 М.
Learning C# In A Week... Otherwise I Fail University
9:04
Гайд по Mirror мультиплееру в Unity 2д
18:29
I Made a Graphics Engine (again)
8:27
Zyger
Рет қаралды 157 М.
How to Make a Multiplayer Game - The Lobby
24:47
Blackthornprod
Рет қаралды 84 М.
1 Year MAKING an OPEN-WORLD game
8:23
AIA
Рет қаралды 728 М.
I Made a Graphics Engine
6:42
Zyger
Рет қаралды 240 М.
How To Make a VR Multiplayer Game -  Part 2 : Relay and Lobby
21:50
Valem Tutorials
Рет қаралды 9 М.
How To Connect Using Steam - Unity Multiplayer Tutorial
21:44
Dapper Dino
Рет қаралды 90 М.
Они убрались очень быстро!
0:40
Аришнев
Рет қаралды 1,4 МЛН
🍁 Последний звонок
0:11
Ка12 PRODUCTION
Рет қаралды 10 МЛН
🍬 Testing the Viral Gummy Pack Opening Lifehack! 🤔 | Epic Fail Alert!
0:40