*IMPORTANT!!!* These are some common issues and changes that are required since curtain parts of this tutorial are out of date. - The package manager is no longer used to install the Firebase packages and therefor the package resolver will no longer appear when installing and the Firebase packages will not appear in the package manager when installed. If you have issues installing the Firebase packages start by removing any Firebase assets you may have in your project. Download the newest .unitypackage file from this link developers.google.com/unity/archive#firebase_authentication. Then in Unity go to Assets > Import Package > Custom Package. Now import the .unitypackage you downloaded. This will install the Firebase core and Firebase auth packages into your Unity project. - There are also some code changes since this video was recorded. Make sure to check the GitHub repo for the most up-to-date code. If you still have issues feel free to open a help post on my Discord server: discord.gg/7rGAAqC
i did remove all old Firebase package and reinstalling with your second Firebase Video, still it doesnt work ... gotta just read manuals instead of following random youtube vids ffs
@Politically WOKE Hindus It should but I would download the Firebase .unitypackages from this link instead. The unity package manager no longer works with the Firebase packages
I had this error when importing it: Assembly 'Assets/Firebase/Editor/Firebase.Editor.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform? And I fixed it by installing iOS support in Build Settings, even though I only wanted to build it on Android. Also it didn't show in Package Manager, only in Assets.
Do you have tutorial on how to connect this authentication login to realtime database?. Im trying to make a money system on a specific authentication account
Actually i am making a chatting application when we select our interest and chat with people based on our interest! This is perfect for the tutorial! :)
Great tutorial! Thanks for making this. Rule of thumb: with starter projects, make them as simple as possible. This means no fancy UI, no custom fonts, and no blurred backgrounds. Making it as complicated as you did will just make it harder for others to change and use in their own project. edit 7/27/22 sorry for being so critical love u zach
@@xzippyzachx In my experience it doesn't really have an impact on the viewers' perception of the tutorial. And it just causes more problems than it helps. I'm just saying its a lot harder to customize and make your own as a user. It can also be more confusing to a beginner because they might not understand how the stylized buttons work of how to use the custom font. Either way, you can do what you want. But in my opinion it does more bad than good.
Man, this is still works good in 2023 (and its almost 2024 apparently). And yes, I did read your pinned comment then everything's clear, thank you and have a good day!
Hey, thanks for tutorial. This worked fine, however when I build to Android, code does not go pass auth.SignInWithEmailAndPasswordAsync function . I get no errors, but it also does nothing.
my login and register is perfectly working with firebase in unity play mode or simulation but in my actual build application its not working, what do you think is the problem? thank youu
@@xzippyzachx good day, I'm building Android app and I see no 64bit in build option just 32 bit, 16 bit, 32 bit and half reso. I'm always on 32 bit when build, still not working sir. Tried switching to windows build and it worked fine, however in android app it still doesn't work.
@@janmenardrodriguez8189 Since the issue is only happening in the android build I suggest finding a mobile console on the Unity asset store so you can see if any errors are being thrown in the actual android build of your game. There are a few free mobile consoles on the Unity asset store. Join my Discord and ask for further help there.
Not really sure what you are asking but I think you might be talking about a room system. Yes it is possible but my game does not use a room system so I don't know how to go about doing it.
Hey man great video, everything went well after following the tutorial now the problem is how do I change the scene only when the user successfully signs in. FYI I subscribed to your channel, hopefully more great up coming content.😉
I think you watched my second video on using Firebase Database. I explain how to change to another UI screen when you log in. You can just change it to go to another scene. Keep in mind that if you change scenes without bringing the FirebaseManager object to the next scene you can not do any Firebase functions in the other scene.
Thk for this video.Im new unity user here it help me a lot bro! Can u make a video share how to build data base like save score with using firebase? Thk!
Hi, love the video but I have a problem installing Firebase, I follow the instructions but when I import the package no Package Manager Resolver pops up ( @4:06 ) also nothing else appears in Package Manager In-Project packages list, I tried installing different versions of unity but nothing. I don't know what to do. Any idea?
I re explain how to install the Firebase packages a better way in my second Firebase video on my channel. Go give it a watch. Make sure to remove all the old Firebase files you may have installed this tutorial from your project before re installing the new way. :p
hey! thanks for helping, I followed the second video but "Packages: My Registries" doesn't appear for me, just "Unity Registry/In Project/My Assets and Built-In", I tried also with a new project, nothing. The url and the scope are correct. I also tried to reinstall unity, just in case. (I'm using unity 2020.2.1f1) I also checked the manifest and it's correct.
@@bjorn84 Ah there is a Unity bug in 2020.2 where `My Registries` wont show. You have to add them manually via the manifest.json file in your /Packages folder. Join my discord server for help.
@@xzippyzachx oooooooooh thanks! I just copied the references from the manifest of one of your projects and now it works like a charm :D thanks a lot :D
Thank you for this tutorial.I have a question.How can i make sure if user stays connected during the game? I mean all details lost after the authentication .How can we detect which user plays the game?
Sry for the late response, RU-vid flagged your comment. Are you changing scenes after you log in. If so you need to make sure to transfer the user variable data between scenes. Join my Discord if you still need help! :p
Thanks for the video really helpful. Just wonder, what happen next after the player complete the account registration and sign in successfully? How to start the game after the confirmation. Thanks
This will really depend on how the code is setup for your game, but in general you would insert your code to continue into the game where we set *confirmLoginText.text = "Logged In";*
Hello. Thank you so much for making this video. I had a question though. Is this a good way to securely store data? Is it easy for players to hack? Thank you!
If you are going to be storing data in the Firebase database the security depends on how you setup your Firebase rules. So I suggest reading the Firebase documentation about Firebase rules if you want to make sure your data is secure.
Hi, there are some things i notice that are different from yours.. 1) once you downloaded the Firebase Unity SDK (Zip) and you extracted it, I see your file name as 'firebase_unity_sdk_6.15.2' in this video. Mine after extracting only says 'firebase_unity_sdk'.. before extracting, mine was saying 'firebase_unity_sdk_12.1.0.zip' 2) In your video, when importing package and after you clicked 'firebase_unity_sdk', you have either 2 options 'dotnet3' or 'dotnet4'.. For me, I don't get those options and instead, it just directs me to 'FirebaseAuth.unitypackage' like how you do in this video.. the only difference is, i dont have the option to click 'dotnet4' 3) After you clicked 'import' in 'Import Unity Package', it automatically shows you the 'Package Manager Resolver' window.. For me, it doesn't show this window.. As a result, when I hover over to Windows>Package Manager> In Project, I don't see the Firebase Authentication in there at all Pls help, thankss
1) Thats fine its just different naming 2) and 3) The method to install Firebase has changed since I made this tutorial. The Unity package manager is no longer used. Read the instructions in my pinned comment on this video for updated instructions. Also join and make a help post on my Discord server for more help.
For those who are watching in 2024. Two error may occur. 1) Firebase error dll error Make sure you have added ios build support and android build , whether you are using it or not. In the auth Manager script:- replace user = LoginTask.Result; and user = RegisterTask.Result; with "user = LoginTask.Result.User;" "user = RegisterTask.Result.User;"
Change the scene after the login is successful. You can trace in the code where I am debug logging that you have been logged in. That's then where you would change the scene.
Nice tutorial: just a word of caution: dont make unnecessary hurdles for players to join your game, if its not really necessary (like in a long running competitive MMO gameworld). Meaning: a small arena shooter should make it possible to log in by just providing a Username/Avatarname (if there is no state like inventory or abilities saved between logins). This removes any hurdles (handing out private information like the email address) to just join a game. A simple persistent account (detecting correct user) can also be created without entering a password: by generating a GUID on the client at account creation, and pushing that to the server to compare and retrieve the former account. Now at each login the client can read out the locally stored GUID and automatically log in without any further input. (this auth string or number could be copied by the player to a different device if player really care for that). And in any case: to only have trusted players on the server you would need to whitelist them manually anyways, or use a private session-password to share with friends.
Yeah I would hope anyone making a serious project would do their own research and implement Firebase the best way that suits their project. This is all good info thanks!
Have you tried what I mentioned in the pinned comment on this video? If that doesn't work then the next step would be to get a developer console running on your mobile device to see if there are any errors. You can also join my Discord and ask for help there.
Hi, thank you for the amazing tutorial. Sadly, I get two errors and can't register new users :( Maybe you know what causes this? 1. "Database URL not set in the Firebase config." 2. "Failed to register task with System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: An internal error has occurred. "
Fixed. The e-mail signing method was disabled in the console, my bad sorry :0 Thanks for the concise tutorial, I really appreciate the editing and how it's well formatted with time stamps and all
Yo ik this is really late but Please help me with this I keep getting these error messages Assets\Scripts\AuthManager.cs(4,16): error CS0234: The type or namespace name 'Auth' does not exist in the namespace 'Firebase' (are you missing an assembly reference?) Assets\Scripts\AuthManager.cs(12,12): error CS0246: The type or namespace name 'FirebaseAuth' could not be found (are you missing a using directive or an assembly reference?) Assets\Scripts\AuthManager.cs(13,12): error CS0246: The type or namespace name 'FirebaseUser' could not be found (are you missing a using directive or an assembly reference?) Please help me I spent my whole day trying to fix this with no luck
Hi. im having problems with 6:58 part. I did exacly as you said in the totorial but when I try to add the script it says that script class cannot be found. do you know what the problem could be?
Hey I finished implementing your tutorial but I am getting this error when I try to deploy on my phone called a failure occured while executing com.android.build.graddle.internal.tasks.Workers$ActionFacade. By the way great tutorial though!
I don't think that error is related to Firebase. It has something to do with building for android. I would google the error and see if there are others with the issue. Thanks :p
I've never seen that error. Make sure you setup your Firebase project to be correctly linked to your Unity project (First part of the tutorial). You can also ask for help on my Discord server were we can troubleshoot easier.
That's correct. The Unity package manger is no longer used by the Firebase SDK so it will not appear in it. As long as you see the Firebase folders in your Assets folder you should be ok.
Hi, thanks for this video.. I'm creating a login and registration for Students to take their MCQ test (they'll have to login and upon successful login, they'll be directed to the test database) So currently I have 2 respective groups: Admin (Teachers) and Trainees (Students) For the Admin, they will have a login button and registration button. I shld be able to follow your video for that without a problem. But however for the trainee scene, I only need to have a login button. So that means that if they are new and need to create a new account or reset password, it is the Admin's responsibility to do it for them. Can I get your help with this and what would be different? Based on your video
I would only have the login option within Unity. For the account registration you could just use the Firebase dashboard to register Trainees. Otherwise this would require some significant changes. Open a help post on my Discord server if you want more help.
Assembly 'Assets/Firebase/Editor/Firebase.Editor.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Assembly 'Assets/ExternalDependencyManager/Editor/1.2.169/Google.IOSResolver.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. can you help me with these errors?
Hi, I am a bit stuck on an error because in the unity editor the login and register system work perfectly fine, but when I built my game and open it as an application the development console throws me an error saying: DllNotFoundException: FirebaseCppApp-6_15_2 , if I ignore the error and continue to login when I press sign in it throws me another error saying: NullReferenceException: Object reference not set to an instance of an object, and after that nothing happens. So yeah I've been fighting this error for about a day and thought maybe if I comment someone might help me.
@@xzippyzachx thanks, ran into the same problem today and after many hours of googling decided to come back here to see if anyone else had the same problem
I can not connect firebase to unity.I tried a lot but it does not work.I tried the package in the description also but it didn't work either.Could you help me ? It's urgent.I have to turn in my homework by tomorrow.
I have followed your pinned post but I'm receiving an error. Is it okay to proceed? I'm on windows btw Assembly 'Assets/Firebase/Editor/Firebase.Editor.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector.
These errors can be resolved by installing the IOS build module via the Unity Hub for your version of Unity. Even if you aren't building for IOS it for some reason complains that its not installed. You can also ask for help on my Discord server if you still have issues.
Thanks, this is very helpful! I'm wondering what the next step is in terms of using the fact that the user is logged in. Does Firebase send the user some kind of authentication token once they have logged in, which can be used to verify their identity on a custom server? I'm imagining that the front-end temporarily stores that auth token, sends it to my Node Express API, my API then sends the token to Firebase to verify that it's real, and then I can provide the user with access to the back-end services that they have purchased. Does that sound right or am I confused about this process?
That sounds exactly correct. I would look through the Firebase documentation to find specifics on how you can do this. You can also ask questions on my Discord and I will try to assist where I can.
that was a nice starting but i had problem after importing firebase SDK before importing sdk i can make a keystore or set a keystore fore project but after importing the sdk unity says wrong password or the path of keystore is wrong but I'm sure both are correct
Yes, this seems to be a common issue that I haven't found a consistent solution to. If possible build the project in x64. Feel free to join my Discord server and share your findings.
I don't 100% know what you are asking. But I think you are asking how to store data for a particular user account. For this you would need to look into using the Firebase database to store data for particular users.
good tutorial but i keep getting this error when clicking the login button NullReferenceException: Object reference not set to an instance of an object AuthManager+d__16.MoveNext () (at Assets/Assets/Scripts/AuthManager.cs:73)
Here comes my necromancer comment: I get an error when I either try User = RegisterTask.Result; or User = LoginTask.Result; Saying that Cannot implicitly convert type 'Firebase.Auth.AuthResult' to 'Firebase.Auth.FirebaseUser' Edit: Fixed change the RegisterTask.Result to RegisterTask.Result.User and LoginTask.Result.User
I'm getting this error and when i try to call functions in unity for buttons i'm also not getting the proper functions in authmanager would u plz help me with that. Assets\Scripts\AuthManager.cs(15,12): error CS0246: The type or namespace name 'Firebaseuser' could not be found (are you missing a using directive or an assembly reference?)
How expensive is it on Firebase if let's say it's used for a multiplayer game? Something like fortnite. I'm guessing they only use database to store player information like items, in-game currency and score and this might not be called as frequently as those real-time action stuffs like handing player movement correct? We would only be making calls to firebase when the game ends, during login, and when purchasing / trading items. The Free firebase tier can store only 1GB of data and I believe there are some other limits like the calls per month. Based on the above scenario, will it wipe out 1GB of data per month making the Free tier insufficient? How many players do you think the free tier can handle? I've search some threads on reddit but can't seem to find any relevant discussions yet. If its going to be expensive are there alternatives to firebase? What about AWS? Or is there any free offerings? I guess if it turns out that the Free version maxes out at 100-1000 players then, maybe for the sake of trouble down the line, some would just be better off linking it to a local database with sql or something similar when starting out as that should offer at least an option to have it hosted by multiple servers in future if required?
The potential cost is a hard question to answer. Its really hard to estimate because no one really knows exactly how much bandwidth their application will use. Which ever route you go it will cost you money at some point but as you said going a custom SQL database solution might be the smarter option so you can switch hosting providers in the future.
There are different methods for authentication with Facebook and Google. I would suggest reading the Firebase docs to figure out how to use them. I haven't used them myself. Good luck!