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...
❤ 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
I do. As a matter of fact, your Unity Ultimate Course is one of my favorites among the courses I have!
Just curious, did you get inspired from fireship for the 100 seconds idea?
@@chuckdude514 I'm glad you enjoy it! Stay tuned for another free update very soon!
@@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
Yes, very interesting format, to discover a tool/plugin.
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.
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.
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
I'm definitely planning on covering several UGS tools which have this Auth requirement as the starting point
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!
Please make complete tutorial series on this whole new unity services.
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
+1
yup, I hope @Code Monkey creates tutorial for fb and google.
incredibly useful and more simple than I expected! Thanks again!
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;
big thank you, I asked about that but youtube/code monkeys removed my question/comment.
StraightForward Tutorial!!!
Very useful feature I will definitely use this in my future projects thank you Codemonkey
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
please make a full tutorial video about unity cloud save & cloud code
Yes i want this too
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!
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
Thanks for this.
seems great !
Legend!
Authentication Successful in 99 sec. Damn
sign in anonymous, but if user change phone?
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.
@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.
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.
@@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...
@@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.
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
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.
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.
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?
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.
@@CodeMonkeyUnity You have made my whole month, dude.
We want to see facebook and google sign in metods thanks a lot!
Can you make a more elaborate video
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.
what are you asking for? "add a character selection to the registration" what does that mean.
how it used for making multiplayer game?
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
@@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
Trying out the Fireship video format? :)
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.
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
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?
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)
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."
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
@@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)
@@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)
How do you get Kite for visual studio code or can you still get it
Playfab authentication, please!
Playfab is something I'd like to research
@@CodeMonkeyUnity It's really, really good. I started using it a few days ago, and managed to run my own server build!
Hey Could you this one over ... just a little slower. a little more in depth. Thanks !
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
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?
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.
@@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 :)
@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)
What details? Like PC specs? You can see that if you also implement Analytics
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.
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.
This video is easy way. Make a video with in google auth and facebook auth. I am challenge you !
You could increase speed of this video by 2 and it would be in 50 seconds! Still useless.
How is it useless? What part can't you understand?
@@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.
I'd assume using OpenID would be cross platform
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
Why you don't uses dark theme
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
Because dark mode burns my eyes, sorry
@@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
Is it ok for unity desktop apps?
Sure, this works with any platform that Unity supports
Why you write private start?
I like to be as explicit as possible in my code so I always add private instead of omitting it.
Nice
Is it hackable?
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
That answers my question, thanks
Literally everything is "hackable"
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.
Now this system supports OpenID so I think you could build your own OpenID provider
@@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. 🤷