How To Display Profile Pictures & Names - Steam Multiplayer Game in Unity
HTML-код
- Опубликовано: 22 май 2024
- 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 - Развлечения
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.
yeah sorry I mentioned this earlier but forgot to pin a comment about it
You literally saved my skin. Thanks so much for pointing this out :):)
thx dude
I love ya man!!
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!
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.
This is intense af and makes brain hurt a bit, but straight to the point thx for such treasure
Really appreciate your tutorials
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.
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
life saver, was looking to see if anyone else had issues with this, thank you!
Another banger tutorial, you upload them so fast!
I spent all day watching you and I see you writing code or something while you sleep :D
?
@@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
Also, the steam profile icon is not visible in my game.
just kidding, never mind
@@Viytek oh ahaha
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
Thanks for the feedback. Definitely will try my best not to do that :)
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
@@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!
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 :)
I had a bit of trouble following along because she talks so fast. Thanks for the tip :)
This was somehow in my algorithm within 30 seconds of upload...not even mad
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.
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!
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"
These tutorials are just too great!
These tutorials are great as, I can't wait to see what else we're gonna learn
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.
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.
Change OnServerAddPlayer(NetworkConnection conn) to OnServerAddPlayer(NetworkConnectionToClient conn)
@Septic Wahab ily😭
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?
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?
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
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.
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.
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?
Question, what if we want to return to lobby from game or leave the lobby/close the lobby without it breaking the game?
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.
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
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?
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
Fixed the issue, I forgot to replace the default Steam App ID with the ID for my game.
I was having the same problem, I solved it thanks to you. Thank you.
"CurrentLobbyID = callback.m_ulSteamIDLobby;" Do not delete your code. :)
@@serefcaliskan4865 👍
mine not working and i have no errors and the player names and prfiles arent showing up
How can I fix this error?
CustomNetworkManager.cs(14,26): error CS0115: 'CustomNetworkManager.OnServerAddPlayer(NetworkConnection)': no suitable method found to override
Pls help my override function OnStartAuthority is not passing. So the function never runs
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
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.
Steam distributes dll files that you can link to and call functions provided in it.
@@pb3dpb3d yes steam api can be used on virtually on anything but I think mirror is unity only.
@@ZygerGFX yeah mirror is made on UNet HLAPI as the compatible alternative to it, so yes - it is unity specific.
WTF, in Lobby controller and in player list item script they arent showing up with any fields!!! HELP PLEASE
I made a join button but its not working will what kind od script need to be on the join button
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
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?
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
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.
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?
What's not working for you we might have the same problem
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.
Unfortunately this uses mirror and facepunch is entirely different. They do have a documentation on facepunch and some examples on github though
for some reason when i click host lobby i see 3 player list items and its all me, how can i fix this?
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
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.
@@IMsTRACH you saved life
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?
Nevermind, It started working now... not quite sure what fixed it though, but most likely a problem on my end.
@@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 :))
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?
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?"
I fixed it sry. I just had to add "()" at the end.
@@cloudie9450 thank you very much man
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
"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?
This is in the network Manager btw.
I have the same problem as well. Wondering how to fix this
I am also seeing this issue.
for anyone wondering this is fine it will work fine like this
Change OnServerAddPlayer(NetworkConnection conn) to OnServerAddPlayer(NetworkConnectionToClient conn)
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
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.
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)
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!
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.
@@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?
@@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
@@kristianwant6775 holy shit i was about to go thru the same rabbit hole, thx
@@ozmega glad I helped! Wish someone had worked it out before me too haha
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 :)
I figured it out. Other UI-Elements were just blocking it... But now my Movement in multiplayer is a problem.
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.
I followed this tutorial but the scene isn't switching when I click the host button.
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....
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
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)
i cant see profile pictures?
17:37 make sure you add the "!", i spent 2 days trying to figure out why my lobby controller wasn't working
Thaaannkkk you I had the same problem and couldnt figure it out the whole day
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 ?
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.
@@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 :)
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?
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.
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.
@@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.
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?
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 ! :)
Thanks for the video! Is it possible to test this with multiple steam accounts without having a second pc?
virtual machine
PlayerListItem not spawned. GamePlayers count = 0.... where did i might wrong
Anyone struggling with the override issue in the CustomNetworkManager change 'NetworkConnection' to 'NetworkConnectionToClient'
thanks bro
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?
I havev the same bug, have you found any solution?
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!
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
@@ZygerGFX thanks for the quick reply lol. this worked and im back in business tysm!
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.
shrek
Hey Cole, Did you ever find out the answer to your question? Im trying to make mine public as well
@@xxtremestudio Hello, did you find out something?? Im trying to make it public too
@@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
@@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
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
I had my awake function in lowercase. tldr im a dingus
@@zachbyron4012 explain because I've been trying to find the instance for ever in the steam lobby video
@@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.
Im sorry but I cant seem to find the "GetSteamImageAsTexture" code:( if anyone know where to find it please tell me:)
sorry about that just realised that its not in the description. ive gone ahead and added it
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!!
did you solve it?
@@skygge1136 hope that helped ^
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);
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
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.
@@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
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;
Did you change the code from:
public class PlayerObjectController : MonoBehaviour .
To:
public class PlayerObjectController : NetworkBehaviour
@@simplisticgames2036 No I did not! Thank you so much for the help! You just saved me lots of time!
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.
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!
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.
@@ZygerGFX hi do you know what the new method names are?
@@kilogram_o7204 Did you get the infos ?
did you fixx
Who edited this video?
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?
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?
@@GougeO Happens to me too, Did you ever find a fix?
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.
the code is good no erorrs but the image is not showing
how to fix this
Check the pinned comment :) hope it helps
Dont know why but my Icons dont load
Same, just stays white
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
Look at the pinned comment but also go back to 1:20 and add this line:
CurrentLobbyID = callback.m_ulSteamIDLobby;
that I accidentally removed.
@@ZygerGFX thanks for your answer, but i have already returned it)
@@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?
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
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.
my name player not add but avatar is work
, what is problem?
Hey please check the pinned comment. If that doesn't work please double check your code and that its the same as the video!
What kind of computer would I need to download Unity
i mean not sure .it doesn't have to be too good. maybe google it
@@ZygerGFX ok Thank you anyway
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)"
private void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(gameObject);
}
else
{
Instance = this;
DontDestroyOnLoad(gameObject);
PlayerListItems = new List();
}
}
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
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"
@@MaxDolotboy did you fix the error?
@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
My icons are transparent and are dull.
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);
I love you
In your CustomNetworkManager script, make sure you put the correct scene name for the lobby.
Thanks Bro
good tutorial but slow down omd
My player icons is so brightness, what I must to do?
Did you get a fix for this?
If only i used Unity these videos would have been more than just being awesome.
7:14
20:50
10:36
I dont use unity but good tutorial
10:6
Could you make a video about game maker 2? (I wanna use it and I don't want to use unity)
sorry but no. i dont own game maker and dont use it anymore
Spaghetti code
what parts exactly? I'd love to improve my code so let me know what parts you think could be better :)
I like you. Can you work on a game with me
thank you. but no sorry I have my own projects that I'm working on.
This seems fun to create, destroy your social life, stop touching grass and start talking in C#... kinda easy ;)
I made 20+ typos because I was so careless. Ahahahahah.
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
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.
Change OnServerAddPlayer(NetworkConnection conn) to OnServerAddPlayer(NetworkConnectionToClient conn)
bool isVaild = SteamUtils.GetImageSize(iImage, out uint width , out uint height); got an error
.GetSteamImageAsTexture(int)': not all code paths return a value
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
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"
@@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
@@sangotwtom5 Moreover, the errors do not point to LobbyController, but to LocalPlayerObject , which does not have text fields
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.
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😂