brb, learning how to make a triple A game from these tutorials!
@ZygerGFX2 жыл бұрын
😂
@nile642 жыл бұрын
just found your channel 30 minutes ago and it has this steam multiplayer series AND a save and load level system? thanks for these tutorials, ill really need them for my game!
@cacula282 жыл бұрын
Hey, nice video, I dont know much about unity or c#, but I think a nice feature to add if you press on the next color arrow and its the end of the color ( a.length ) it will go back to the first color so it will still switch colors and wont stuck. =)
@ZygerGFX2 жыл бұрын
Yeah that's definitely what I would do if I continued the project. For the video I didnt bother adding it but definitely a great idea.
@yll1b5962 жыл бұрын
Seems like a fairly simple fix by just checking which button you hit and if the current index is at the end, set it to the start value
@Shahmuradov2 жыл бұрын
You can edit your script to this for that functionality :) using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Steamworks; using Mirror; public class CharacterCosmeticsController : MonoBehaviour { public int currentColorIndex = 0; public Material[] playerColors; public Image currentColorImage; public Text currentColorText; private static string CURRENT_COLOR_INDEX = "currentColorIndex"; private void Start() { currentColorIndex = PlayerPrefs.GetInt(CURRENT_COLOR_INDEX, 0); UpdateNewColorUI(); } public void NextColor() { if (currentColorIndex < playerColors.Length - 1) { currentColorIndex++; PlayerPrefs.SetInt(CURRENT_COLOR_INDEX, currentColorIndex); UpdateNewColorUI(); } else if (currentColorIndex == playerColors.Length - 1) { currentColorIndex = 0; PlayerPrefs.SetInt(CURRENT_COLOR_INDEX, currentColorIndex); UpdateNewColorUI(); } } public void PreviousColor() { if (currentColorIndex > 0) { currentColorIndex--; PlayerPrefs.SetInt(CURRENT_COLOR_INDEX, currentColorIndex); UpdateNewColorUI(); } else if (currentColorIndex == 0) { currentColorIndex = playerColors.Length - 1; PlayerPrefs.SetInt(CURRENT_COLOR_INDEX, currentColorIndex); UpdateNewColorUI(); } } private void UpdateNewColorUI() { currentColorImage.color = playerColors[currentColorIndex].color; currentColorText.text = playerColors[currentColorIndex].name; } }
@danharris7735 Жыл бұрын
If you are having trouble with the colours not updating, it's because the CmdUpdatePlayerColor function is never called. To resolve this, you need to reference the LobbyController Instance (specific to the player), call the cmd function and input the index number from the lobby via the use of: LobbyController.Instance.LocalplayerController.CmdSendPlayerColor(index); This is my version of the CharacterCosmetics.cs class, I've used TMPro instead of the UI component as the old text features are now not recommended in later Unity versions. I also removed the 'PlayerPrefs.GetInt("currentColourIndex", 0);' in the start function, as it would cache previous choices which I didn't want to implement in my interpretation. Wrapping was also added so when you reach the last colour, it loops back to the first! ---------------------------- using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; using Steamworks; using Mirror; public class CharacterCosmetics : MonoBehaviour { public int currentColorIndex = 0; public Material[] playerColors; public Image currentColorImage; public TextMeshProUGUI currentColorText; private void Start() { // Generate new Steamworks variable, and set to 0 if not already created // currentColourIndex = PlayerPrefs.GetInt("currentColourIndex", 0); SetColor(currentColorIndex); } private void SetColor(int index) { PlayerPrefs.SetInt("currentColourIndex", currentColorIndex); currentColorImage.color = playerColors[currentColorIndex].color; currentColorText.text = playerColors[currentColorIndex].name; LobbyController.Instance.LocalplayerController.CmdSendPlayerColor(index); } public void NextColor() { if (currentColorIndex < playerColors.Length - 1) // Increment currentColorIndex++; else if (currentColorIndex == playerColors.Length - 1) // Wrap currentColorIndex = 0; SetColor(currentColorIndex); } public void PreviousColor() { if (currentColorIndex > 0) // Decrement currentColorIndex--; else if (currentColorIndex == 0) // Wrap currentColorIndex = playerColors.Length - 1; SetColor(currentColorIndex); } }
@kcdahnert Жыл бұрын
HI. I too do not get the chosen colors applied. I replaced your code into CharacterCosmetics.cs but then got this below error. Are there some other code changes to other scripts? : error CS1061: 'PlayerObjectController' does not contain a definition for 'CmdSendPlayerColor' and no accessible extension method 'CmdSendPlayerColor' accepting a first argument of type 'PlayerObjectController' could be found (are you missing a using directive or an assembly reference?). Thanks!
@XathosLP Жыл бұрын
@@kcdahnert It's because you cmd is called 'CmdUpdatePlayerColor', not 'CmdSendPlayerColor' (if you strictly followed Zyger's tutorial :) )
@grambino862210 ай бұрын
It works but I keep getting this error: Command System.Void PlayerObjectController::CmdUpdatePlayerColor(System.Int32) called on PlayerObject without an active client.
@xyoxus2 жыл бұрын
You should set the Steam Mulitplayer Tutorial playlist to automatically sort from oldest to newest, it currently is all over the place and will always happen again if you don't set the sorting of it.
@Shahmuradov2 жыл бұрын
I made this playlist so I can find them easily if I need it. But it is public, so you can save it too :) kzbin.info/aero/PLmMS--T1mpeGNrVYu9L97fL7ks7yegWHN
@WolfServant2 жыл бұрын
Thank you for making these tutorials Zyger it's helped me a ton!
@faiazbinnesar29372 жыл бұрын
Another Banger and the exact thing I needed❤
@EntikaiCG2 жыл бұрын
Another fantastic tutorial. Thanks for the upload!
@ZygerGFX2 жыл бұрын
thank you
@germaincasse2 жыл бұрын
Thanks, great tutorial!
@ZygerGFX2 жыл бұрын
Thanks !
@Xian_NoTTV Жыл бұрын
Awesome tutorial serie, really helpful and straight forward. It might be awesome if you could create a tutorial for making a two teams game. I can't figure out how to modify your script to make the networkmanager split players into different teams. I tried by myself and even asked to ChatGPT but it's the same; a bunch of errors or the script isn't working as intended. When I managed to make it work, the original GamePlayer is still spawning and isn't controlled by anyone in the middle of the scene. Thanks a lot for this tutorials btw taught me a lot about NetworkBehaviour and how to manage a multiplayer lobby!
@teddy61782 жыл бұрын
Thank you, you’re amazing!
@yaaannn81262 жыл бұрын
YEEEESS FINALYYY
@Bloopblop12 жыл бұрын
What a helpful tutorial enjoyed it ❤️
@Shadowkiwi2 жыл бұрын
For some reason the color is never set, it just uses the color in the 0 value. I downloaded the source files and ran that project and it also does not work there. I think the issue is that "CmdUpdatePlayerColor(int newValue)" does not appear to ever be called but not sure where to put that.
@WolfServant2 жыл бұрын
I posted a comment that should help you out.
@Shadowkiwi2 жыл бұрын
@@WolfServant Posted a comment where? I don't see anything else from you in the comments on this video
@Shadowkiwi2 жыл бұрын
@@WolfServant Nevermind I got it working. I added the FindLocalPlayer method and varibales from the lobbycontroller script into the CosmeticController and added a line to call the command from the playerobject controller: LocalplayerController.CmdUpdatePlayerColor(currentColorIndex);
@brunoayre22342 жыл бұрын
@Frosty could you fully explain what you did to solve this?
@brunoayre22342 жыл бұрын
@@Shadowkiwi Could you fully explain what you did to solve this?
@madpingui50072 жыл бұрын
1:35 UsingEngine.UI Steamworks ... And finally using Mirror Proceeds to use Microsoft instead hahahah Nice video btw, I think multiplayer is something that is not taught much, thanks.
@ZygerGFX2 жыл бұрын
yeah i changed it after but forgot to show it hahah. thanks a lot !!
@fuzzyleon17732 жыл бұрын
Hey Zyger, I'm a 3D modeller who's trying to make a game on his own. I can't code a bit but thanks to you I've already got multiplayer running. I tried adding a "leave lobby" and "leave game" button myself, but it's still to much for me. Especially the fact that if the host leaves that you need A. Host migration or B. force quit everyone back to main menu. I'm also thinking of just stopping the game and returning everyone to lobby when one player leaves, since it's a 1vs4 game. But could you perhaps make a tutorial about that? A leave lobby and leave game button? I've been searching and asking people for 5 days now but no one seems to be able to help me :(
@dekirudev2 жыл бұрын
Been trying to figure that out myself...
@Shahmuradov2 жыл бұрын
Nice tutorial! But I have a question. In CharacterCosmeticsController we added Steamworks and Mirror libraries, but never used it. Will we be using it in the next tutorials? Because right now they seem unnecessary and I want to remove them from top of my script :D
@ZygerGFX2 жыл бұрын
Yeah no remove them there's no need for them. i think i kept that in because originally I was going to do something but then edited it out.
@sajadtroll91862 жыл бұрын
amazing
@3ABKRENOGAMER2 жыл бұрын
Hello can u PLZ do an tutorial about player health sync ♥
@not_vdb00592 жыл бұрын
Hey i really like your vids coups you Mauve make a tutorial on how to make a prophunt game?
@erenbatu1009 Жыл бұрын
hi how do I add the libraries: Steamworks and Mirror
@SantaGamerYoutube Жыл бұрын
google them
@YoNatrix Жыл бұрын
how to make backbutton in lobby?
@ozalpm2 жыл бұрын
I have a question, how can one player trigger another player's component. I will be very happy if you answer
@notanagger4861 Жыл бұрын
How would one go about creating a leave function to leave the lobby?
@ZygerGFX Жыл бұрын
there are different ways but I posted a solution in my discord server
@NBGTZ2 жыл бұрын
The color dont change its stuck on blue even if i change in the lobby its still stuck how can i fix it?
@kili85172 жыл бұрын
Hey Zyger, I tried to make that if one player picked a color, others player can't pick it. But I can't make it work? How can I do this?
@ZygerGFX2 жыл бұрын
You would have to keep track of what color someone picked, probably like an I'd for each color index. That data would need to be sent to every user so I'd probably send the data when somebody locks in a color. I'd then just make it so that if a player clicks on a color and its index is on that list it doesn't let them pick it. Of course you can make it looks more polished with a visual indication or something. It shouldn't be too difficult and there's multiple ways to go about it but the one I proposed here should be quite straight forward.
@lofiscide2 жыл бұрын
Zyger still play indie games?
@aonalt2 жыл бұрын
When new tutorial?
@ZygerGFX2 жыл бұрын
Soon just working on some atm
@aonalt2 жыл бұрын
@@ZygerGFX What will it cover?
@mrpoint1013 Жыл бұрын
player select pls)
@minecraftcompilationz2 жыл бұрын
Second!
@mdcdev_11 ай бұрын
do you need to purchace anything to test these
@ZygerGFX11 ай бұрын
no you dont. You just need to install steam which is free. Bare in mind though if you do actually plan to release your game, purchasing a steam application would be wise, but still not 100% necessary.
@mdcdev_11 ай бұрын
thank you@@ZygerGFX
@RubikMaster132 жыл бұрын
First!
@mylogic1562 жыл бұрын
i cant find where were syncing the player color int for the life of me, if anyone knows please help edit; i know that its a syncvar but where are we making it equal to the Character select's current color index?
@mylogic1562 жыл бұрын
found it, i added playerMat = PlayerPrefs.GetInt("currentMatIndex", 0); to the update method now both players are the same color when im scrolling through the list tho, progress
@mylogic1562 жыл бұрын
Got it! i called the CommandUpdatePlayerColor(); in the update method, then i passed in the colorIndex from the CharacterCosmeticsScript, so CommandUpdatePlayerColor(characterCosmetics.colorIndex); this seemed to fix my problem, though, it will be updating the color every frame so i recomend making an if statment to check if ur out of the character customization screen, and then disabling it if u are also discard my previous comment about the PlayerPrefs in the update method, doesnt work Hope i Helped Someone out!