Unity Authentication in 100 SECONDS! (Log in, Anonymous, Unity Gaming Services, Cloud Save, Relay)

Поделиться
HTML-код
  • Опубликовано: 10 ноя 2024
  • ❤ Watch my FREE Complete Multiplayer Course • Learn Unity Multiplaye...
    🌍 Get my Complete Courses! ✅ unitycodemonke...
    👍 Learn to make awesome games step-by-step from start to finish.
    👇 Click on Show More
    🎮 Get my Steam Games unitycodemonke...
    🌍 Unity Authentication Docs docs.unity.com...
    🔴 RELATED VIDEOS 🔴
    Unity Gaming Services? Free Unity Multiplayer? Backend? Monetization? • Free Unity Multiplayer...
    Ultimate Unity Overview (50+ Tools and Features Explained!) • Ultimate Unity Overvie...
    💬 Learn how to use Unity Authentication, it lets you sign in your player (anonymously and without friction), and generate a unique user id which you can then use to interact with all the various Unity Gaming Services like Cloud Save, Multiplayer, Relay, Matchmaker, etc.
    Alternatively you can also link with a third party id like Google, Apple, Steam and Facebook.
    📝 Some Links are Affiliate links which means it costs the same to you and I get a nice commission.
    🌍 Get Code Monkey on Steam!
    👍 Interactive Tutorials, Complete Games and More!
    ✅ store.steampow...
    If you have any questions post them in the comments and I'll do my best to answer them.
    🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
    See you next time!
    📍 Support on Patreon / unitycodemonkey
    🎮 Grab the Game Bundle at unitycodemonke...
    📝 Get the Code Monkey Utilities at unitycodemonke...
    #unitytutorial #unity3d #gamedev
    --------------------------------------------------------------------
    Hello and Welcome!
    I'm your Code Monkey and here you will learn everything about Game Development in Unity using C#.
    I've been developing games for several years with 8 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
    I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.
    You can see my games at www.endlessloopstudios.com
    --------------------------------------------------------------------
    Other great Unity channels:
    Unity - / unity3d
    Brackeys - / brackeys
    Dani - / @danidev
    Jabrils - / @jabrils
    BlackthornProd - / @blackthornprod
    Sykoo - / sykootv
    Jason Weimann - / @unity3dcollege
    Jonas Tyroller - / @jonastyroller
    --------------------------------------------------------------------
    Website: unitycodemonke...
    Twitter: / unitycodemonkey
    Steam: store.steampow...

Комментарии • 94

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  2 года назад +12

    ❤ Watch my FREE Complete Multiplayer Course ruclips.net/video/7glCsF9fv3s/видео.html
    💬 Do you like this format? Could be useful for super quick overviews of certain tools, let me know.
    🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
    🎮 Need Realistic Fantasy visuals? Check out this HumbleBundle 96% OFF! www.humblebundle.com/software/ultimate-unity-fantasy-rpg-bundle-software?partner=codemonkey
    🌍 Unity Authentication Docs docs.unity.com/authentication/
    🔴 RELATED VIDEOS 🔴
    Unity Gaming Services? Free Unity Multiplayer? Backend? Monetization? ruclips.net/video/JwClCc2_zC8/видео.html
    Ultimate Unity Overview (50+ Tools and Features Explained!) ruclips.net/video/Hd6K7mfXt08/видео.html

    • @chuckdude514
      @chuckdude514 2 года назад +1

      I do. As a matter of fact, your Unity Ultimate Course is one of my favorites among the courses I have!

    • @SamarthCat
      @SamarthCat 2 года назад +1

      Just curious, did you get inspired from fireship for the 100 seconds idea?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      @@chuckdude514 I'm glad you enjoy it! Stay tuned for another free update very soon!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      ​@@SamarthCat Heh yup I love those videos, really awesome to get a quick overview of a language/toolset. When I saw how quickly this tool can be set up I thought about trying out a similar super quick format

    • @Tactic3d
      @Tactic3d 2 года назад

      Yes, very interesting format, to discover a tool/plugin.

  • @michaelp8376
    @michaelp8376 2 года назад +37

    This is great info, thank you!
    To answer your question: no, the format was horrible =). Personally, I do not care if it is under 100 seconds. I do care if it is simple and to the point. A 5 minute video is better than a 1 minute video if it is more clear to the user.

  • @Robertganca
    @Robertganca 2 года назад +19

    I knew about Unity services, but I didn’t know about anonymous login. And it can apparently be connected to Steam, nice. Thanks for the tip.

  • @TheOneWithComments
    @TheOneWithComments 2 года назад +9

    This made me realize how little I know about this topic ;-; I hope you are planning on doing longer videos on this topic because I think it would be very helpful

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +8

      I'm definitely planning on covering several UGS tools which have this Auth requirement as the starting point

  • @doublehitgames531
    @doublehitgames531 Год назад +9

    Please, do a full tutorial about Authentifaction and Cloud Save. Starting with a Anonimous login, saving and loading clud data saved and using anonymous id for register to a provider like as google account. This will be amasing!

  • @Wonder_Verse_Tech
    @Wonder_Verse_Tech 2 года назад +6

    Please make complete tutorial series on this whole new unity services.

  • @allaboutpaw9396
    @allaboutpaw9396 Год назад +6

    Loved it. I made it anonymous but then I am having trouble to connect it to Google, Steam etc... The documentation lacks in many ways. Could you provide a tutorial for that? There is no tutorial on youtube for this as of today. Thanks

    • @AisnerA
      @AisnerA Год назад +1

      +1

    • @jrpenanueva1479
      @jrpenanueva1479 Год назад +2

      yup, I hope @Code Monkey creates tutorial for fb and google.

  • @j.j.maverick9252
    @j.j.maverick9252 2 года назад +1

    incredibly useful and more simple than I expected! Thanks again!

  • @reaporofdragon744
    @reaporofdragon744 Год назад +8

    I'm getting 2 errors can anyone help me ?? first error is cs0161 and the second one is cs0246
    its on the async Task SignInAnonymouslyAsync
    Edit: Found it it needs this in the script
    using System.Threading.Tasks;

    • @Steve-gi2yj
      @Steve-gi2yj Год назад +1

      big thank you, I asked about that but youtube/code monkeys removed my question/comment.

  • @michailmarkou1995
    @michailmarkou1995 2 года назад +2

    StraightForward Tutorial!!!

  • @Etka06
    @Etka06 2 года назад +1

    Very useful feature I will definitely use this in my future projects thank you Codemonkey

  • @DwightPotvin
    @DwightPotvin 2 года назад +4

    I may have missed it, but could you possible do a tutorial on how to properly authenticate a steam ID using Unity Authentication? I tried to use the code they have on the website and I just an invalid token error so clearly I am doing something wrong lol

  • @parsagg_player8885
    @parsagg_player8885 Год назад +2

    please make a full tutorial video about unity cloud save & cloud code

  • @94Kansas
    @94Kansas 2 года назад +2

    Nice video and format to discover some new feature!
    It would be great to see how save cloud works, since I don't know a good method to cloud save for Apple and Android multiplaform.
    Thanks!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +2

      Yup Cloud Save is indeed the UGS tool that I was researching when I saw the requirement for Authentication so that lead me to researching this

  • @Synith19
    @Synith19 2 года назад +1

    Thanks for this.

  • @samuelkohn7282
    @samuelkohn7282 2 года назад

    seems great !

  • @aussieraver7182
    @aussieraver7182 Год назад

    Legend!

  • @hammadahmad462
    @hammadahmad462 2 года назад

    Authentication Successful in 99 sec. Damn

  • @crashzzalex9218
    @crashzzalex9218 Год назад +1

    sign in anonymous, but if user change phone?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      If you only sign in anonymously then it will only be stored locally on that phone. If you want to allow the player to switch devices you need to use one of the persistent sign in methods.

  • @jacobbender974
    @jacobbender974 2 года назад +2

    @Code Monkey - curious (if you have experience with either) how you think this lineup of services compares against PlayFab/GameSparks - a lot of these things seem to be Unity wanting to provide direct offerings in-house. I use PlayFab for my own projects and a lot of what I have seen from Unity Services seem to match 1:1.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +4

      I'm aware those services exist, Playfab seems to be very popular, but never used it myself so can't really comment on a direct comparison.
      Playfab has existed for a long time so it's pretty mature by now, UGS is newer but Unity seems to be focusing heavily on it. I've been researching some services and so far everything seems pretty great, easy to use, and great pricing.
      Although for example, there's no Leaderboards or any kind of global accessible data (which I think Playfab has), and Cloud Save has some weird limitations (16KB per file), so perhaps Playfab is the more feature-rich toolset at this time.

    • @jacobbender974
      @jacobbender974 2 года назад +2

      @@CodeMonkeyUnity Appreciate the response (and your content in general) - I guess my hesitation is the history Unity has of saying they will support/invest into something and then it being deprecated a year later. The way they handled removing UNET left a bad taste. I think I will stick with PF for now, but maybe these services will prove an exception to that rule. One thing I will say though, is this seems like a good way to vendor lock yourself into a backend, given the tight integration with the Unity Engine specifically - if you ever switched engines, I wonder if it would even be possible to use these services...

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +2

      ​@@jacobbender974 Most of the UGS are actually engine agnostic, they have simple APIs to work with any engine. Famously Apex Legends uses Multiplay, Vivox, Matchmaker, and it's not made in Unity.
      But I understand your concern, although Unity is pushing hard for UGS to gain adoption and with a pay as you go model I don't think they will leave these tools at all, it feels like they're pushing hard for these tools to become one of their main revenue sources so I believe they will support them with all their resources for a long time.

    • @kdeger
      @kdeger 2 года назад +1

      I know this is a UGS video but for leaderboard, tournaments etc I can suggest Nakama(Heroic Labs, the guys created Godot), an open source service, also provides a cloud service too called Heroic Cloud

  • @michelvarilek1244
    @michelvarilek1244 2 года назад +1

    Thank you for this short tutorial! I have been looking into Unity Authentication recently. Do you know if this is a good alternative to the somewhat recently deprecated feature of reading the serial number on Android devices to identify devices? I am working on device-bound licensing for a VR application (on Quest and Pico) and since the unique serial number (since android level 29) is not accessible anymore, it seems to me the best alternative is to create a unique identifier on the device and store it somewhere safe/hidden - which Unity Authentication also seems to be doing.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      If you use anonymous log in then yeah this is essentially a device identifier. Although if the user clears their cache and deletes Unity's PlayerPrefs then the id is lost and a new one is generated the next time they open the game. So if your concern is something secure that the user cannot change then I don't think this will work.

  • @MisterCrispyFL
    @MisterCrispyFL 2 года назад +1

    Wait a sec… since when does Unity support async/await?! Every tutorial I’ve ever come across talks about using that CoRoutine junk. Is this just for the login stuff or was it added and no one updated their tutorials?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      I has supported it for a long time, Unity is currently on C# 9 I believe, although yeah it's not widely used, some other async Unity tools, like Addressables, use callbacks instead of directly async await.

    • @MisterCrispyFL
      @MisterCrispyFL 2 года назад

      @@CodeMonkeyUnity You have made my whole month, dude.

  • @force.4game649
    @force.4game649 2 года назад

    We want to see facebook and google sign in metods thanks a lot!

  • @mcgator1208
    @mcgator1208 Год назад

    Can you make a more elaborate video

  • @talismanskulls2857
    @talismanskulls2857 Год назад

    Literally do not see (and have tried for over a year now) to add a character selection to the registration. I have asked all over the place how to integrate them. I either get "Google it" or some other nonsense of "it should be simple but no one is going to hold you hand." I am not asking for a hand hold. I am asking for guidance how to do that correctly leaving me to assume no one actually has a clue and its frustrating. I can create one or the other but can't integrate them. I know I am not the only one with that issue.

    • @bigcaka7725
      @bigcaka7725 10 месяцев назад

      what are you asking for? "add a character selection to the registration" what does that mean.

  • @EnderElohim
    @EnderElohim 2 года назад +1

    how it used for making multiplayer game?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +2

      This is used for generating a user id, with that then you can identify the user in the various UGS tools like Relay/Lobby/Multiplay/Matchmaker

    • @EnderElohim
      @EnderElohim 2 года назад

      @@CodeMonkeyUnity A video about multiplayer useage would be amazing. So can you like get the information of all other users id and do stuff with it? Hmm interesting

  • @TommyTheITGuy
    @TommyTheITGuy 2 года назад

    Trying out the Fireship video format? :)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +2

      Heh kind of, I love those videos and when I saw how quickly this tool can be set up I thought it would be perfect to experiment with this format.

  • @Developer_rapfa
    @Developer_rapfa Год назад

    how to retrive data from a spcefic user? i mean i can only load data from my own ID , how can u access to other id's? as an admin i mean

  • @r6scrubs126
    @r6scrubs126 2 года назад +1

    so what's the purpose of an anonymous logon? If its anonymous that means it doesn't identify the user, so how can you get their cloud saves etc?

    • @r6scrubs126
      @r6scrubs126 2 года назад

      reading up on it some more on the unity docs and I *think* the way it works is that if you do an anonymous logon it will generate an account on the unity servers that can only be logged in to using a token that gets downloaded to the user's device the first time your game performs an anonymous logon. So if they used a different device they would not be recognised and wouldn't have access to those old cloud saves etc, which to me defeats the point of all of this. I guess this is only useful if you just want to use their service to do P2P relaying or something that does not actually depend on identifying the user (although in which case, why do you even need to do any kind of authentication at all)

    • @r6scrubs126
      @r6scrubs126 2 года назад

      oh right yeah their documentation basically says its just to lure people in lol
      "Once a player becomes invested in your game, prompt the player to upgrade their anonymous account to sign in with a platform account. A benefit of signing in with a platform account makes a player’s game progress recoverable if they want to switch devices and continue playing, or access items gained or purchased in the game."

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      It identifies the user with a unique id but knows nothing else about the user (name, email, etc)
      Yes being anonymous means it's not multi-device, but just having that player id on that one device already allows you to interact with various UGS like Relay, Mathcmaker, Lobby, Multiplay, Cloud Save, Economy, IAP, etc

    • @r6scrubs126
      @r6scrubs126 2 года назад +1

      @@CodeMonkeyUnity yeah for relay etc I can see it being useful but anonymous cloud save is completely pointless isn't it? What use is a cloud save if you can't access it from another device (or even the same device that has had the game or OS reinstalled)

    • @BrahimHadriche
      @BrahimHadriche 2 года назад

      @@r6scrubs126 The point of the anonymous login is to give the player an identifier so they can do things related to these services without having to manually input their info, so it's a less disruptive experience (e.g. they can start playing right away) later they can "link" their account with an actual social login, which will allow them to "preserve" that previous progress they did while they were anonymous. This is useful to engage the player with the gameplay first, and allow them later to login (so they can continue their progress on a different device for example)

  • @everythingbyisaac
    @everythingbyisaac 2 года назад

    How do you get Kite for visual studio code or can you still get it

  • @XboxPlayerPL
    @XboxPlayerPL 2 года назад +2

    Playfab authentication, please!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      Playfab is something I'd like to research

    • @XboxPlayerPL
      @XboxPlayerPL 2 года назад +1

      @@CodeMonkeyUnity It's really, really good. I started using it a few days ago, and managed to run my own server build!

  • @carlosbautista2392
    @carlosbautista2392 Год назад

    Hey Could you this one over ... just a little slower. a little more in depth. Thanks !

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад

      What would you like to know more in depth? There's not much depth to this package, you just sign in and that's it

  • @Steve-gi2yj
    @Steve-gi2yj Год назад

    Sorry I have a question, I am trying to setup OpenID, however its asking info on it, do I just make the info up? make my own Oidc name, client ID and OIDCName html? I tried making or inputting stuff and i get "Invalid OIDC Parameter". any thoughts?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      I haven't tried building OpenID from scratch so not entirely sure but yes if you're creating it then you define what name it has and whatever other info it needs. Maybe one of the parameters is some key that needs to be generated in some specific way? Really not sure.

    • @Steve-gi2yj
      @Steve-gi2yj Год назад

      @@CodeMonkeyUnity awesome thanks for answering, i will try this out and let you know, maybe something as simple... and i will pass on any info i find. thanks again :)

  • @Jobzachariah
    @Jobzachariah Год назад

    @CodeMonkeyUnity Is there a way to see in unity dasboard the details of users who have used anonymous login (userID's just like in firebase database)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад

      What details? Like PC specs? You can see that if you also implement Analytics

  • @TheIronicRaven
    @TheIronicRaven 2 года назад

    Is this something that is done server side, or client side? If I have my server running and a player joins in, would I attach the authentication code to the server player that spawns, or to the client one? It makes the most sense to me to be the server side, but I am not sure which one it is targeting.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      This is to identify the client, it's not strictly related to multiplayer, for example you authenticate the player and then use Cloud Save to retrieve a save file.

  • @alperensisman6002
    @alperensisman6002 2 года назад

    This video is easy way. Make a video with in google auth and facebook auth. I am challenge you !

  • @davk
    @davk Год назад +2

    You could increase speed of this video by 2 and it would be in 50 seconds! Still useless.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад

      How is it useless? What part can't you understand?

    • @davk
      @davk Год назад +1

      @@CodeMonkeyUnity Thank you for your reply. Sure, let me explain. I am a beginner and you say "register to authentication events", "make a function to sign anonymously", " you can link it later to user accounts" etc. Yeah, I can watch other videos that will tell me how to do it. This video didn't teach me anything. None of the functions from the title in brackets are explained. Therefore this was useless to me.

  • @MichaelEvanspishposh
    @MichaelEvanspishposh 2 года назад

    I'd assume using OpenID would be cross platform

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      Heh yup I believe that would work, they literally added that option 2 days after I published this video, I definitely want to research that because I think it does indeed enable cross platform

  • @marwaneh5277
    @marwaneh5277 2 года назад +11

    Why you don't uses dark theme

    • @j.j.maverick9252
      @j.j.maverick9252 2 года назад +1

      this was asked on a different video recently, Hugo says it’s because dark mode hurts his eyes. If you struggle with the white, try turning your device screen brightness down… modern screens are much too bright by default (unless you’re in bright daylight) so I keep mine at less than 50 brightness

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +7

      Because dark mode burns my eyes, sorry

    • @r6scrubs126
      @r6scrubs126 2 года назад +1

      @@j.j.maverick9252 you're not kidding. I have mine set to literally as low as it will go and its still too bright sometimes

  • @genius-b1180
    @genius-b1180 Год назад

    Is it ok for unity desktop apps?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад

      Sure, this works with any platform that Unity supports

  • @OneKekc
    @OneKekc 2 года назад

    Why you write private start?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +4

      I like to be as explicit as possible in my code so I always add private instead of omitting it.

  • @chaostellar
    @chaostellar 2 года назад

    Nice

  • @chaostellar
    @chaostellar 2 года назад

    Is it hackable?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      Not sure what you mean by "hackable", it's a unique id and an access token, without the access token you cannot impersonate another persons id

    • @chaostellar
      @chaostellar 2 года назад

      That answers my question, thanks

    • @diadetediotedio6918
      @diadetediotedio6918 2 года назад

      Literally everything is "hackable"

  • @illsaveus
    @illsaveus Год назад +1

    Is there a way for a player to setup a username and password without using any of their google/Facebook/apple/steam accounts? Basically just enter a username and password to create an account.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      Now this system supports OpenID so I think you could build your own OpenID provider

    • @illsaveus
      @illsaveus Год назад +1

      @@CodeMonkeyUnity this whole aspect of user auth is so confusing. Could you do a video explaining it? I’m trying to understand how to add a simple username/password safely without having ppl opt in to have their social media connected and tracked. But I’m so lost in the weeds doing AWS Cognito stuff but maybe OpenID through UGS is better. 🤷