Unity Firebase Database Integration - Easy Tutorial

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024

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

  • @玉少宸
    @玉少宸 Месяц назад +2

    I am using Unity and Firebase database to build a small Android game. It runs well on my computer, but when I download the game onto my phone, all the Firebase-related functionalities stop working. Have you ever encountered this issue? I’ve searched a lot on the browser but haven’t found a suitable solution. I’m really at my wit’s end.

  • @BAE-Mars
    @BAE-Mars 10 месяцев назад +1

    but dude when i build and run it in my android phone it does not update the the data in database

    • @cody_pie
      @cody_pie 10 месяцев назад +1

      I have made a quick video on that bro, I hope it helps 🎉

    • @BAE-Mars
      @BAE-Mars 10 месяцев назад

      i already fixed the problems :) 😄@@cody_pie

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

    error cher...Assembly 'Assets/ExternalDependencyManager/Editor/1.2.176/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.

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

      SAME ERROR!!!. Plz any fix? I have to complete project within few days

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

      @@kushal6065its for apple

    • @cody_pie
      @cody_pie 11 месяцев назад +1

      It's because you haven't installed the iOS module! It shouldn't affect if you're building just for Android!

    • @raresnarpo2609
      @raresnarpo2609 3 месяца назад

      unity 6

  • @Tom-c5s6c
    @Tom-c5s6c Год назад +2

    Thank you for the video! It was very informative and easy to follow.

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

    Thank you for this. Simple and to the point!

  • @davenirline
    @davenirline 2 года назад +3

    Got link to example of fetching multiple data? For example for high score, I want fetch the other players that are near the current player's score.

  • @patrick17_6
    @patrick17_6 2 месяца назад

    Nice video editing & outro

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

    I have some question I thoroughly do and listen to the instruction you show. Why when I put it in the saved button on "On click ()" and when I click that in the no function there are three which is like that (in the video) Game Object, Transform and the Object that I create which is "Database Manager" then when I hover my mouse into that there are no "CreateUser ()" so I was wondering if I've done something wrong ?

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

      Check if your CreateUser() function is public

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

    showing error - DatabaseException: Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your GetInstance() call.
    (unable to get the root reference of database )

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

      Did you find a fix

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

      @@beatsbytex nope, i used firebase firestore

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

      @@arifraza1266 thanks for the reply. I ended up giving up and using Unity CloudSave, works great for me.

    • @177unneh
      @177unneh Год назад

      DBReference = FirebaseDatabase.GetInstance("Your DatabaseURL ").GetReferenceFromUrl("Your DatabaseURL"); it work for me

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

      change google-services.json file. I fixed it with that.

  • @funduino8322
    @funduino8322 2 года назад +5

    Thank you , very simple to follow. is there a way to fetch multiple data at once, for example get the name and gold in the same snapshot? perhaps fetch the root object?I imagine it will make work much less

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

      Yes it is possible. Just fetch the parent.

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

    hello i have an urgent question, whate are you dragging to the database script file in minute 3:24 I don't get it I'm trying to do something similar but I don't know what to drag there.

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

      i tried dragging my input field but its not accepting it to be dragged onto the script 's empty variable

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

      @@armenapkarian9230 ı have the same problem

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

      same problem@@armenapkarian9230

    • @BAE-Mars
      @BAE-Mars 10 месяцев назад

      the input field must be textmesh pro so instead of @@armenapkarian9230 public InputField Gold; write this public TMP_InputField Gold;

  • @tangengcheng7733
    @tangengcheng7733 6 месяцев назад

    After I import the 'FirebaseDatabase.unitypackage' file, I got many errors like:
    `Assembly 'Assets/ExternalDependencyManager/Editor/1.2.179/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.
    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.`

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

    i have problem with the "GetName" and "GetGold" methods ( get value button ) whenever i click on the get value button on runtime, it gives me a nullreferenceException. i followed every step but it doesnt display name or gold on the screen, it complains on both methods on the "onCallback.Invoke((int)snapshot.Value);

  • @shahvaizjahangeer318
    @shahvaizjahangeer318 5 месяцев назад

    Thank you so much. Helped me alot.

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

    3:23 in this part does not appears CreateUser() for me

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

      because this guy created CreateUser function as private and then changed to public without saying.

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

    What if I want to login with my data, but from a different device than the one which I've created my account with? Since that's going to have a different deviceId?

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

      When you log in from a different device, you can update your new deviceid with the old one by logging in with your email or username.

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

    Is it safe? I mean for how I know DB connections like this we usually have a PHP Layer. Is it safe to skip that with using these methods? Is that layer already there but hidden from the user?

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

    Huge Huge thanks maaan you saved my life

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

    Can I use this for a web gl build unity project? I can't find the google-services.json file for my existing build.

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

    I keep getting forbade creation app failed when I click save button. Please help

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

    Im havin an issue I cant seem to solve. Theres an error "Firebase app creation failed" Does anyone know whats going on?

    • @GameCore-pu2xt
      @GameCore-pu2xt Год назад

      me too :*(

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

      have you find a way around it? I still cant lmao@@GameCore-pu2xt

  • @tiagoalmeida2194
    @tiagoalmeida2194 Год назад +5

    You are fetching each property of each user by having to create a function for each property, that isn't very scalable at all, if you had a user with 50 properties, you would have to build 50 functions, and your class would look a horrible spaghettified code
    Its better to just get the entire User Json (for each User on the Database) and deserialize it to the User Class you created, this way you can have as many properties on the User class has you want and it wont affect anything
    Other than that, great tutorial!

  • @احمد-ك7ج7غ
    @احمد-ك7ج7غ 2 года назад

    When importing packages I get error when enter ketstore password 😢 and when I remove all of firebase packages keystore work again , any one know how to fix that?

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

    Brother where did learn the coding can u share it

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

    Well I have questions is when I made a multiplayer with a firebase and I want to publish my game so yeah it's ok about it

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

    Videonun ilk 4 saniyesinde telaffuzdan oturu "Lan Turk lan bu" diyisim :) ilk defa goruyorum kanalini, basarilar diliyorum.

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

    nice video.. very simple to follow

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

    Can I take this sample project? Thanks!

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

    Do you know how to find google firebase for credentials authcode

  • @carlosa2843
    @carlosa2843 8 месяцев назад

    Funciona bien en el editor, pero al exportar el APK no funciona en android, ya cree una KEYSTORE y puse la huella SHA en FIREBASE.

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

    Would this work on Unity WebGL?

  • @aakashrocks100
    @aakashrocks100 3 года назад +6

    Very nice and informative. Please make use of other firebase package like realtime database, authentication, Firestone etc. Thanks

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

    why you always update you name. if you are new user you have to create ,but your name is exist

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

    Olá amigo
    estou tentado fazer uma integração da unity com firebase
    para controlar um relé com o esp8266 mas não estou conseguindo
    fazer a alteração da string, se você puder mim ajudar ficarei muito
    agradecido.
    Seria mais ou menos assim:
    chave: led
    valor: "0"
    assim:
    led: "0"
    e quando eu clicasse novamente no botão mudaria de estado para
    led: "1"

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

    Hi, great video and tutorial!
    Wanted to let you know that for me, the function .SetRawJsonValueAsync(json) didn't work, it wouldn't write anything to the database, but with .SetValueAsync(json) it works like a charm.
    Given this, is there something I need to look out for in regards to using .SetValueAsync() vs .SetRawJsonValueAsync()?
    Edit: It seems like the reason SetRawJsonValueAsync() did not work was that I was trying to Serialize properties instead of raw members.
    Thanks!

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

      Hey, do you know how to create more Users? Everytime I execute the game, it just updates the current user instead of creating a new user

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

      @@MisterEyes00 If you haven't figured it out already, the reason might be that he uses the unique device number identifier to store users. So in order to create different users, you'd have to use different devices or assign custom id numbers :)

  • @Crickmoney24
    @Crickmoney24 2 месяца назад

    I want database for unity game on website (not app) with firebase

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

    Thanks so much from brazil

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

    Is there one for Webgl?

  • @diegolarrieta7665
    @diegolarrieta7665 8 месяцев назад

    Works the same with FireStore DataBase?

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

    Hello! The video is great and easy to follow. Can you make a tutorial where we can call multiple data? 🙏🙏

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

    Hi, a really useful video in whole YT, not many videos for this simple and clear. 👍👍
    p.s:- I'm working on an AR app in Unity and want to *dynamically* click and upload images to the firebase.
    Could u please mention the changes required in the above video tutorial or do we need whole new approach.
    pps: I tried with vuforia image targets but there is no such thing available

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

    Its a very nice video, thanks for making it, i subscribe instantly, but I dont understand the difference between updating and creating, if i delete the user in the database and just update it has the data the same way, then why is it different?

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

    Are you Turkish guy ? :)) Your accent is very similar to Turkish :) I have just curious

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

      im turkish and i confirm

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

      Yes I'm :)

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

      @@SoloGameDev Aha dedim video yabancı gibi, bir tıkladım türk :)

  • @FahadBilal-b9c
    @FahadBilal-b9c Год назад

    its a great thing if you share project or at least script also !

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

    heyyy!! Is this tutorial also valid for multiplayer games in unity?

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

    it doesnt support to deskop

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

    Is there a way to check user cheating when we are using Firebase ?

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

      they shouldnt be able to cheat if you put your data serverside. unless they are gods and can hack google.

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

      @@skyz3ra A hacked client can send false data to the database from game easily. If there is no database & serverside scripts probably its best to use a service like Playfab to use cloud scripts.

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

      @@fuxingdi5548 If you modify your variable in your codes by recieving it from database. There is no way to change a variable which is stored and modified in only server.

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

    its not showing the total gold

  • @톰-l2o
    @톰-l2o Год назад

    I don't want to run CreateUser() on the first connection and CreateUser() on the second connection. What should I do? Ican't find //

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

    Very simple and cool !
    How about safety ?
    How can we be sure that a malicious player send false data to the database ?

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

      That's a different matter. Obviously, it would not be right to use it for very important data. Safest to use with simpler data.

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

      @@SoloGameDev Got it,
      Would be great to have a more advanced/safe tutorial so we can actually implement those type of solutions in a production =)

  • @SolarSoftMedia
    @SolarSoftMedia 9 месяцев назад

    It's very clear, but what percentage of people are going to have name and gold as options? I think a more suitable tutorial would have been username/email and password. I guess I'll have to figure parts of this out.

    • @SolarSoftMedia
      @SolarSoftMedia 9 месяцев назад

      I wish I knew what version of Unity you were using because Firebase doesn't work on the most recent stable version.

  • @АлександрВладимирович-л9ы

    Видео класс, но база данных не добавляется в проект. Покажите пожалуйста более детальные настройки UNITY

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

    Ağzına sağlık bro

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

    Great video! Can I get the scripts from anywhere?

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

    too many bugs from just following the steps, please post an updated

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

      There is no bug. What is your problem ?

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

      @@SoloGameDev Following all the steps to press button to create user I get 5 errors in console, too long to post here. Firebase app creation failed, unable to load firebase app options, object reference not set to an instance of an object. firebase editor dll will not be loaded due to errors...

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

      @@SoloGameDev are there prepatory steps like packages or versions that matter? I really want to make this work

  • @clowd1e449
    @clowd1e449 Год назад +3

    too buggy, and no help...

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

    if you can make easyFirebase authorization for android, we would be really grateful my Lord

  • @koritsuruneterra5951
    @koritsuruneterra5951 10 месяцев назад +1

    can you watch your video before you upload them, you cant talk clearly

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

      I have small video on that hope it helps! Any way solo dev creates some awesome stuffs, i think theres some sort of problem in here

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

    put script on chat please

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

    bookmark: 3:36

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

    no one can understand your tutoirals or your accent

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

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

    Compilre errors:
    Assembly 'Assets/ExternalDependencyManager/Editor/1.2.177/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?

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

      same RIP

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

      that wont affect you if you are building android app only, it is because you didnt have iOS build installed

    • @cody_pie
      @cody_pie 11 месяцев назад +1

      It's because you haven't installed the iOS module! It shouldn't affect if you're building just for Android!

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

      Also i made a video specific for remote config

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

    Olá amigo
    estou tentado fazer uma integração da unity com firebase
    para controlar um relé com o esp8266 mas não estou conseguindo
    fazer a alteração da string, se você puder mim ajudar ficarei muito
    agradecido.
    Seria mais ou menos assim:
    chave: led
    valor: "0"
    assim:
    led: "0"
    e quando eu clicasse novamente no botão mudaria de estado para
    led: "1"

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

    Olá amigo
    estou tentado fazer uma integração da unity com firebase
    para controlar um relé com o esp8266 mas não estou conseguindo
    fazer a alteração da string, se você puder mim ajudar ficarei muito
    agradecido.
    Seria mais ou menos assim:
    chave: led
    valor: "0"
    assim:
    led: "0"
    e quando eu clicasse novamente no botão mudaria de estado para
    led: "1"