Unity - Get data from Google Drive ( JSON data, Images, ... )

Поділитися
Вставка
  • Опубліковано 4 гру 2020
  • #madewithunity #unity3d #unity #indiegame #gamedevelopment #gamedev
    How to get JSON data and images from Google Drive in Unity
    ■ASSETS :
    github.com/herbou/Unity_GetDa...
    □LINKS GENERATOR :
    herbou.github.io/GoogleDriveD...
    🌐Follow Me :
    Facebook : / h.herbou
    Instagram : / hamza_herbou
    Behance : www.behance.net/hamza_herbou
    ❤Support Us :
    ☞Paypal :paypal.me/hamzaherbou
    ☞Patreon : / herbou

КОМЕНТАРІ • 157

  • @cricketinteractive4857
    @cricketinteractive4857 3 роки тому +6

    Simple way to connect external data to Unity. I have been following and have implemented your other playerprefs tips as well to load and save data in my project. Very useful tips.

  • @narotokun1
    @narotokun1 3 роки тому +1

    Chdid tbarkellah 3lik khouya hamza , Amazing ♥

  • @ragerungames
    @ragerungames 3 роки тому

    nice one!! you always comes up with something new!

  • @danieldemattosgoncalves1702
    @danieldemattosgoncalves1702 3 роки тому +4

    Que beleza!!! Parabéns! Obrigado! From Brazil!

  • @badis6717
    @badis6717 3 роки тому +1

    I NEVER THOUGHT THAT I CAN EVEN DO THIS! SERVER AND UNITY THAT EASY SO COOL

  • @mohibkhan2492
    @mohibkhan2492 3 роки тому

    Great work man!

  • @antshestak6543
    @antshestak6543 Рік тому

    Thank a lot for your vids. :) Hope to see some more.

  • @salomehenaovalencia4337
    @salomehenaovalencia4337 Місяць тому

    Amazing video, thank you so much!

  • @micahjimoh5365
    @micahjimoh5365 3 роки тому

    Wow sir you are AMAZING. THANK YOU. This just changed everything.

    • @herbou
      @herbou  3 роки тому

      ❤❤❤❤

  • @abdesamad6616
    @abdesamad6616 3 роки тому

    thank you so much for sharing. you one of a kind ♥️

  • @ManjeetKumar-xk8jf
    @ManjeetKumar-xk8jf 3 роки тому

    You always amazes me.

  • @rudrarajkadel1994
    @rudrarajkadel1994 3 роки тому

    Great work !!

  • @dermotbyrnemusic
    @dermotbyrnemusic 2 роки тому

    Thank you so much for this!

  • @shahriarislam8383
    @shahriarislam8383 2 роки тому

    Thanks bro.... Very cool tutorial.

  • @ibrahimrashwan
    @ibrahimrashwan 8 місяців тому

    Thanks, I didn't know about the direct download link thing

  • @sergio2681
    @sergio2681 3 роки тому

    Ok, you told me you are not God, but you help me again bro, really thanks for your work.

    • @herbou
      @herbou  3 роки тому +1

      you're welcome bro . I'm trying to do the best and share everything to help others and that makes me happy.
      especially comments like yours ❤ it motivates me a lot
      thank you

  • @pbayat6667
    @pbayat6667 2 роки тому

    Thanks a lot, you are amazing 👏

  • @gameplayhubindia
    @gameplayhubindia 2 роки тому

    Great brother,
    Nice tutorial 👍

    • @herbou
      @herbou  2 роки тому

      Thank you! Cheers!

  • @Chandan-xz8cd
    @Chandan-xz8cd 3 роки тому

    thanx bro it's too helpful😇

  • @gamepro-pv8to
    @gamepro-pv8to 3 роки тому

    Thank you bro 👏👍

  • @rafaelladeia7278
    @rafaelladeia7278 2 роки тому +1

    Thank you! One question, is it possible to store the image in user device?

  • @rendrarahardian
    @rendrarahardian 2 роки тому

    thanks for very useful tutorial. may i ask something pardon me, i have written as you did, but why only text which updated, my raw image still nothing happen. thanks for your help before.

  • @breynartstudios
    @breynartstudios 3 роки тому +3

    Thanks for that clear tutorial! Is there any chance that you could make another tutorial to upload or update that JSON from within Unity?
    I really appreciate your work, thanks for sharing!

    • @herbou
      @herbou  3 роки тому +2

      in this case it's better to use another solution : Firebase storage

    • @breynartstudios
      @breynartstudios 3 роки тому

      @@herbou I used Firebase in another project but it's far more heavy and complex that the JSON staff. Thanks for answering ;)

    • @DopEZTam
      @DopEZTam 3 роки тому

      @@herbou Can u do this but instead of Json use python

  • @walney2008
    @walney2008 3 роки тому

    hello, i would like to learn how to use images generated by google maps, google earth, to create scenarios for games, and also how to make missions system as in joho il-2 for example, thanks

  • @barcaedits19
    @barcaedits19 3 роки тому +1

    THIS GUY DESERVES 10M SUBS
    WELL YOU CAN CHANGE YOUR CHANNEL NAME FROM HAMZA HERBOU TO UNITY TUTS OR ANY COOL NAME SO THAST PEOPLE CAN RECOGNZE YOU AND YOUR GROWTH WILL BE AWESOME AS YOUR VIDEOS ARE VERY MUCH HELPFUL AND A LOT MORE AMAZING.YOU CAN ALSO TRY TO ADD YOUR VOICE IF IT IS POSSIBLE EASILY
    WELL AWESOME VIDEO BRO :)

    • @herbou
      @herbou  3 роки тому

      thank you my friend ❤

  • @gabrielnapoli7253
    @gabrielnapoli7253 3 роки тому

    Hey! Amazing job you're doing here! Just a question, how would it be if I wanted to retrieve a whole folder from google drive and store it somewhere on my device? (using unity)

    • @danhowitt4386
      @danhowitt4386 2 роки тому

      Did you ever figure this out please?

  • @altuntas777
    @altuntas777 3 роки тому

    you are genius;)

  • @stefan429
    @stefan429 Рік тому

    Any ideas for how to get it working on webgl? Getting CORS errors when trying to GET files

  • @xX...I...Xx.
    @xX...I...Xx. 2 роки тому +1

    Puedes hacer un tutorial de mostrar datos de una tabla de google sheets porfavor
    Donde pueda leer datos en texto en la pantalla de unity

  • @urnamed32
    @urnamed32 2 роки тому

    Is it only read only or can we change/write from unity to json?

  • @misal-isahabe5281
    @misal-isahabe5281 8 місяців тому

    Hello, I can not update data we can get add delete but not update how can we do that? And is there any solutition for all players can reach same data using google drive or any other third party? Thanks.

  • @minx660
    @minx660 3 роки тому +1

    Thank you for the guide, it seems quite easy to do it but how can I do this with a text file/ csv instead?

    • @herbou
      @herbou  3 роки тому

      yes it's the same thing except when you load csv in unity you need to parse the data (read the data line by line)

  • @SAandT
    @SAandT 2 роки тому

    hi bro, i follow your steps but, the iserror function return "unknow error", i hope your help, thanks in advance

  • @parasgoyal515
    @parasgoyal515 2 роки тому

    What if we want to download the file in the local storage of the system not in the unity

  • @lkghost7
    @lkghost7 3 роки тому

    cool coloring, what is this IDE?

  • @lemulitestudio
    @lemulitestudio 2 роки тому

    Great tutorial,
    Your videos are alway something new to learn from
    Is it possible to use post instead of get to update strings floats or int on the json file with may be like creating a separate client app for updating the json file datas...?

    • @herbou
      @herbou  2 роки тому

      I don't have any idea . but I think it's better to use firebase for that

    • @lemulitestudio
      @lemulitestudio 2 роки тому

      @@herbou I am hoping you do a tutorial like this one using firebase in the future 👍

  • @namthangnguyen8033
    @namthangnguyen8033 Рік тому

    Will the downloaded data be lost when the app is closed or will it still be there?

  • @4nl0ck
    @4nl0ck 3 роки тому

    Great bro, you are amazing. Is it possible to download a 3d model in unity with .json?

  • @hondayadav9527
    @hondayadav9527 3 роки тому

    ❤️❤️❤️

  • @MAzefuhd
    @MAzefuhd 3 роки тому

    nice.
    NIIIIII9ICECEIEIECIEICEICIEIC AMAZNG GG U R THE BOSS

  • @Classic-2connect
    @Classic-2connect 3 роки тому

    Thank youuuuuuuuuu

  • @riblehunter5945
    @riblehunter5945 3 роки тому

    what version unity you are using?

  • @beneilton1000
    @beneilton1000 Рік тому

    This works from export data instead of geting from drive?

  • @leandro_damasceno
    @leandro_damasceno 5 місяців тому

    Hi Hamza.
    I implemented the video and everything has been working fine for 6 months. But it suddenly stopped working a week ago. Do you know if there have been any changes to the json system with Unity recently?
    In the Unity editor I now receive the following error message when trying to download the file:
    ArgumentException: JSON parse error: Invalid value.
    UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at :0)
    UnityEngine.JsonUtility.FromJson[T] (System.String json) (at :0)
    Everything had been working fine for 6 months without any errors until last week. :(
    Thank you very much for your tutorial videos!

  • @Mabox-sc5iz
    @Mabox-sc5iz 2 роки тому

    Does anyone know if the file can be edited or can only be read?

  • @carolinschabbing1908
    @carolinschabbing1908 3 роки тому

    Hello! Thank you for your tutorial - I have two questions. On is regarding the following error. CS0618 "UnityWebRequest.is network error is deprecated. Use (UnityWebRequest.result == UnityWebRequest.Result.ConnectionError) instead." unfortunately even if I use the .result example it will lead to an compiler error.
    And opening Unity Console : ArgumentException: JSON parse error: The document root must not follow by other values.
    UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at :0)
    Secondly, I would like to ask to which extent it would be possible to create a request with a path to my drive desktop application?

    • @herbou
      @herbou  3 роки тому +1

      check the github link in the description

  • @rodrigosa8154
    @rodrigosa8154 Рік тому

    Muito obrigado irmão.. resolveu meu problema...aahahahahaaj

  • @danhowitt4386
    @danhowitt4386 2 роки тому

    Could this handle 3d models?

  • @Medo-hb7bn
    @Medo-hb7bn 2 роки тому

    we need the same thing wth saving data from unity to google drive text editor

  • @byholaz
    @byholaz 3 роки тому

    Excuse me, i have a question, i want to update my file a my repository in google drive ....i use android in my project...how i do it?

    • @herbou
      @herbou  3 роки тому

      i don't know what you mean by updating file

  • @Mainsubzero
    @Mainsubzero 3 роки тому +1

    Hello. What should be done to upload two or three photos instead of one?

    • @nabilhamouda1472
      @nabilhamouda1472 3 роки тому

      hi did you succeed with this problem to get more than one ?

    • @nabilhamouda1472
      @nabilhamouda1472 3 роки тому

      @@Mainsubzero how did you add it to the Script ?

  • @krishnodas8267
    @krishnodas8267 3 роки тому

    please give me "unity install setup file" google drive link. I'm new.

  • @nikoyaz
    @nikoyaz 5 місяців тому

    can i do it with docs too??

  • @babitajoshi9128
    @babitajoshi9128 3 роки тому +1

    From where you find music for your videos

    • @herbou
      @herbou  3 роки тому

      youtube audio library

  • @slybss5588
    @slybss5588 3 роки тому

    Make a tutorial in which you make animation for pennies in 3 d space, in canvas image, please.

  • @rajeshreeparmar8226
    @rajeshreeparmar8226 2 роки тому

    Amazing tutorial but i have a one question if i have this type of data then how to retrieve
    {
    "Scores" :[
    {
    "Away_score" : 1
    },
    {
    "Away_score" : 2
    }
    ]
    }

    • @herbou
      @herbou  2 роки тому

      check this:
      ua-cam.com/video/-Z4s7aIn-Og/v-deo.html

  • @mohammadsiefaddeenkh.abual8982
    @mohammadsiefaddeenkh.abual8982 2 роки тому

    Will the image link yo json method will work for Android studio?

  • @rajkubal8703
    @rajkubal8703 3 роки тому

    Thanks for the content..it was really helpful....but I needed a help as I'm stuck at an error...error is: when I play the scene .it starts f9.. connects to json file...but at line wherein we store data in structure.. it gives an error saying "Missing a name for object member".. Can you please help me out with it🙏

    • @herbou
      @herbou  3 роки тому +1

      show me your json and your struct

    • @rajkubal8703
      @rajkubal8703 3 роки тому

      @@herbou thank you for the help and responding so fast. But I found my error and have fixed it (error were the json file format). Thank you. Your contents help a lot, so please keep making more😇🙏.

  • @ApexArtistX
    @ApexArtistX 3 роки тому

    Next saving and loading google sheet data

  • @nabilhamouda1472
    @nabilhamouda1472 3 роки тому

    wallah bravo bro, sou2el : if i have for example 3 pictures which i want to get them in same time i mean through a next button and back it takes you to next image,,, how can i change the Script and the Json file ?

    • @herbou
      @herbou  3 роки тому +1

      hadchi khasso tutorial 😂

    • @nabilhamouda1472
      @nabilhamouda1472 3 роки тому +1

      @@herbou hhhhhhhh you are so pro bro , you can do it besa7 huwa nafs El concept juste array to add it to Script for 3 pictures for example ..hiya me3raftesh ndirha

    • @molamul1384
      @molamul1384 2 роки тому

      @@nabilhamouda1472 nfs blan chno drti fih f lkhar l9iti l7ala ??

  • @chaostellar
    @chaostellar 3 роки тому

    Is it possible to upload data to google drive, like saving player data

    • @herbou
      @herbou  3 роки тому

      sorry . i don't have any ideas about that

  • @venomfire1596
    @venomfire1596 10 місяців тому

    Is this works after the app is build to ?

    • @herbou
      @herbou  10 місяців тому

      it should work

  • @RahulGupta1981
    @RahulGupta1981 3 роки тому

    how would you work with multiple data? and not just one JSON data. Also is it possible to post and update JSON file from unity?

    • @herbou
      @herbou  3 роки тому

      you can work with multiple data in one json file.

    • @herbou
      @herbou  3 роки тому

      I'm sure there is a way to update data from unity . using APIs to access google drive files

    • @RahulGupta1981
      @RahulGupta1981 3 роки тому

      @@herbou can you make tutorial for that?

    • @herbou
      @herbou  3 роки тому

      i can't now. it may take a lot of time in researches

  • @nguyeninhtai5244
    @nguyeninhtai5244 2 роки тому

    It's working for mobile ?

  • @tianshixie9655
    @tianshixie9655 2 роки тому

    I use my own picture on my Google drive and use the generate tool to get the image link. But the image still load failed? Could you help me to check that? Many thanks! I changed your image link, it works well! Is there any other permission change in google drive?

    • @herbou
      @herbou  2 роки тому +1

      you can use github to store images and get direct links from there

    • @tianshixie9655
      @tianshixie9655 2 роки тому

      @@herbou Thank you so much!

  • @unitygame6398
    @unitygame6398 3 роки тому

    Will this be restricted from accessing by google ??

  • @gurseetsinghahuja6089
    @gurseetsinghahuja6089 3 роки тому

    bro it's not working I am getting an error
    1. Some scripts have compilation errors which may prevent obsolete API usages to get updated. Obsolete API updating will continue automatically after these errors get fixed.
    2. All Compilers errors have to be Fixed (when i click on play button)

  • @Tamdev9
    @Tamdev9 3 роки тому

    about google driver. It can access in all country in the world?

    • @herbou
      @herbou  3 роки тому

      yes

    • @Tamdev9
      @Tamdev9 3 роки тому

      @@herbou cool man, I think you should make a video like that about addressable to store game asset (prefabs) too :D

    • @herbou
      @herbou  3 роки тому

      thank you for your suggestion 😊

  • @hamzanour1212
    @hamzanour1212 3 роки тому

    A lah i7fdak akhoya had l video nfa3ni bzzaf khossossan tandir l call admob IDs mn json . thank you so much.
    o3andi wa7d so2al ila momkin tjawb wash kayna shi tari9a tsawb wallpaper fl unity ?

    • @herbou
      @herbou  3 роки тому +1

      ila kan ghir tjbd wallpapers mn server o tbynhom f game had tari9a nit rah khdama ..

    • @hamzanour1212
      @hamzanour1212 3 роки тому

      @@herbou oui bghit njbad wallpapers mn server lgame o7ta download l phone . wash had tari9a momkina fl unity.

    • @herbou
      @herbou  3 роки тому +1

      ma9lbtch mais ghatkon

    • @hamzanour1212
      @hamzanour1212 3 роки тому

      @@herbou Ok khoya lah i7fdak

  • @pykaiturn
    @pykaiturn Рік тому

    i will face with 403 error because the app doesnt have any permission to access google drive content

  • @rahulrajendrasaw
    @rahulrajendrasaw 3 роки тому

    What about multiple photo how to do that

    • @herbou
      @herbou  3 роки тому

      just watch this playlist and you will get the idea 😊
      Load data from server (text/images) in Json format: ua-cam.com/play/PLMWgYNtBT-xOnWLfohr_1CwEIB5IT_62H.html

  • @micahjimoh5365
    @micahjimoh5365 3 роки тому

    Does this work with videos?

    • @herbou
      @herbou  3 роки тому

      I've never used videos with unity.. but i'm sure it will work

  • @pantaredreammaker
    @pantaredreammaker 3 роки тому

    works in videos too?

  • @moadigitalart
    @moadigitalart 3 роки тому

    whether the image can be replaced with a video

    • @herbou
      @herbou  3 роки тому

      yes it's possible, check the comments

    • @moadigitalart
      @moadigitalart 3 роки тому

      @@herbou Sorry, I'm still a beginner...
      can you make a video like this but more than 1 picture

    • @herbou
      @herbou  3 роки тому

      Load data from server (text/images) in Json format: ua-cam.com/play/PLMWgYNtBT-xOnWLfohr_1CwEIB5IT_62H.html

    • @moadigitalart
      @moadigitalart 3 роки тому

      i use unity 5.6.6f2

  • @user-jn9te9sj2p
    @user-jn9te9sj2p 3 роки тому +1

    قناتك من افضل القنوات التعليمية واصل .
    هل هنالك طريقة لتحميل فيديو عبر جوجل درايف .عندي تطبيق لكن مساحة التطبيق كبيرة واريد حفظ فيديوات في جوجل و اللاعب يقوم بتحميل الفيديوات لمرة واحدة فقط .هل يوجد حل

    • @herbou
      @herbou  3 роки тому +1

      لم اجرب من قبل لكن متأكد ان هناك طريقة في مكان ما

    • @user-jn9te9sj2p
      @user-jn9te9sj2p 3 роки тому

      @@herbou شكرااااا اخي على الرد .لقد وجدت طريقة لتحميل من جوجل درايف ومن فاير باس .شكرا مرة اخرى على الرد و شكرا على فيديواتك تعليمية الرائعة 👏👏👏👏

    • @nabilhamouda1472
      @nabilhamouda1472 3 роки тому

      @@user-jn9te9sj2p سلام صديقي .. لدي أيضا نفس المشكل ..مع فيديو لا يشتغل و لكن مع الصورة يعمل جيدا ....كيف وجدت الحل من فضلك ؟

    • @user-jn9te9sj2p
      @user-jn9te9sj2p 3 роки тому

      @@nabilhamouda1472 public string link;
      public Slider progressBar;
      public Text m_downloadProgress;

      void Start()
      {
      }
      public IEnumerator ShowDownloadProgress(UnityWebRequest www)
      {
      while (!www.isDone)
      {
      Debug.Log(string.Format("Downloaded {0:P1}", www.downloadProgress));
      m_downloadProgress.text = (string.Format("{0:P1}", www.downloadProgress));
      progressBar.value=www.downloadProgress;
      yield return new WaitForSeconds(.01f);
      }
      m_downloadProgress.text="100";
      }
      IEnumerator DownloadVideo()
      {
      UnityWebRequest www = UnityWebRequest.Get(link);
      // mirrors.standaloneinstaller.com/video-sample/lion-sample.mov
      StartCoroutine(ShowDownloadProgress(www));
      yield return www.SendWebRequest();
      if (www.isNetworkError || www.isHttpError)
      {
      Debug.Log(www.error);
      }
      else
      {


      string _pathToFile = Path.Combine( Application.persistentDataPath,numbr+ ".mp4");
      Debug.Log("m" + _pathToFile);
      File.WriteAllBytes(_pathToFile, www.downloadHandler.data);
      }
      public void Stardown()
      {
      StartCoroutine(DownloadVideo());
      }
      }

  • @misterreels88
    @misterreels88 9 місяців тому

    Bro your video was very helpful but one problem after so many time fetching data from google drive i get 401 error. because of this players cannot download images at least for 5 min, but after 5 minutes it is ok but many players complaint about it they face this problem constantly. is there any solution for this error?

    • @herbou
      @herbou  9 місяців тому

      you can use this plugin in this video
      ua-cam.com/video/loUfR04HqHs/v-deo.html
      to cache images so that you don't have to download it each time . only one time at the game start .. then the next request will be in the next game run

    • @misterreels88
      @misterreels88 9 місяців тому

      Bro thanks a lot for replying and sparing some of your precious time for me. But saving like that won't work. Because I will be updating the images and string weekly and If I set the save method, I have to set the expiration date for that image. But such things are hard for me. But i shall do as you said. I am also looking to see if there is any other way. Reply only if you get time. I am satisfied with your first reply itself. You are so good thank you.

    • @herbou
      @herbou  9 місяців тому

      you can save the images only when the game is running .. when the user quits the game and restart again the game downloads the images again .. this method will make sure that always one request is executed the google drive

    • @misterreels88
      @misterreels88 9 місяців тому

      Thanks bro that's a good solution. So can you tell me the part about that plugin that saves the image in the cache? I have very little knowledge in unity and coding so I didn't understand where in your video you talk about that plugin so can you mention the time?❤️

    • @misterreels88
      @misterreels88 9 місяців тому

      Is that struct data saving everything?

  • @muhammadhassan581
    @muhammadhassan581 2 роки тому

    Hi work in editor fine but not on android device do you know how to solve this?

  • @cobraandcheetara
    @cobraandcheetara 3 роки тому

    How do I make the URL be data.json?

    • @herbou
      @herbou  3 роки тому

      watch the full video

    • @cobraandcheetara
      @cobraandcheetara 3 роки тому

      @@herbou I have seen it complete but I want it for this that you show in this video ua-cam.com/video/z-H37N6Mjlk/v-deo.html and how you teach how to do it here does not work for me because the URL I need cannot carry .com and it must end in data.json for it to work, otherwise it gives me this error in console. ArgumentException: JSON parse error: Invalid value.
      UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at : 0)
      UnityEngine.JsonUtility.FromJson [T] (System.String json) (at : 0)
      UpgradeSystem.NewUpdatesPopupUI + d__8.MoveNext () (at Assets / Game / scenes / NewUpdatesPopupUI.cs: 58)
      UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at : 0)

  • @rahulrajendrasaw
    @rahulrajendrasaw 3 роки тому

    Do a tutorial on google drive new API.

    • @herbou
      @herbou  3 роки тому

      if you mean the c# script. just check the github link .
      i changed it to the new API

  • @DopEZTam
    @DopEZTam 3 роки тому

    Can u do thing but instead of Json use python

    • @herbou
      @herbou  3 роки тому

      we can't compare these 2 things,
      JSON is a data interchange format , and Python is a programming language.
      what do you mean by using python???
      the right thing is to compare between JSON & XML
      or
      C# & Python

    • @vinyas0795
      @vinyas0795 3 роки тому

      @@herbou xml is better then

  • @berkcan3475
    @berkcan3475 2 роки тому

    doest work

  • @teptephudsadin6770
    @teptephudsadin6770 3 роки тому

    UnityWebRequest.GetTexture (url) ; to UnityWebRequestTexture.GetTexture(url);

  • @nsmartreview2647
    @nsmartreview2647 2 роки тому

    Your video is dynamic too good but plz when u make video say something not music