Displaying REAL-WORLD Weather in Unity (using REST APIs)

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2019
  • Welcome to PolyMars, a channel focused on game development in Unity!
    In this video, I explain how I used the DarkSky weather API with Unity to display the current real-world weather in my (or any user's) location. Enjoy!
    Project repository:
    github.com/PolyMarsDev/Real-W...
    Music from filmmusic.io/
    "Chipper Doodle v2" by Kevin MacLeod (incompetech.com/)
    License: CC BY (creativecommons.org/licenses/b...)
    Follow me on Twitter for more frequent updates on my projects!
    / polymarsyt

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

  • @100secks2
    @100secks2 3 года назад +171

    making this in wallpaper engine would be dope

  • @qui-gonjinn8048
    @qui-gonjinn8048 3 года назад +252

    "Using Unity's Particle System..."
    *Dani Intensifies*

    • @scattagain
      @scattagain 3 года назад +5

      I liked your comment with all my 15 accounts (IDK why I have them) and now you're at the top

    • @VortechBirb
      @VortechBirb 3 года назад +1

      @@scattagain liar there's 14 likes lol

    • @scattagain
      @scattagain 3 года назад +1

      @@VortechBirb youtube system lags sometimes, now its 15 but I think one is yours

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

      @@scattagain nice can you sub to me on all 15

    • @KnightoftheSorryFace
      @KnightoftheSorryFace 3 года назад +5

      @@prizmatik8696...

  • @tyleranders9972
    @tyleranders9972 4 года назад +166

    Great video. Finally some different content from what everyone else is doing.

  • @lincolnsnewaccount41
    @lincolnsnewaccount41 3 года назад +70

    wait imagine if there was a survival platformer that used a real life day/night cycle and this. For example:
    Foggy: makes it impossible to see faraway things
    Rain: Makes it slippery
    Cloudy and Clear: N/A
    Snowy: Makes it slightly harder to move
    Thunder: Rainy but more deadly (Thunder kills you instantly unless more max health is added)

    • @uniriah24
      @uniriah24 3 года назад +3

      This is a cool idea

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

      @@uniriah24 And i would use it... IF UNITY FUCKIN WORKED FOR ONCE.

    • @wenelol
      @wenelol 3 года назад +1

      @@lincolnsnewaccount41 I feel this.

    • @10secanimations51
      @10secanimations51 3 года назад +2

      @Ezequiel Ciamparella yep

    • @MetaCzech
      @MetaCzech 3 года назад +3

      @Ezequiel Ciamparella question of game design: you can be in-game in different location then in real life

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

    I stumbled on your channel yesterday. I will never regret this.

  • @bapookie
    @bapookie 3 года назад +88

    waiting for raining weather
    Califrona Summer Players: Oh No

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

      Arizoninans :

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

      Oklahmoa

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

      the Sahara desert players:

  • @dr.unventor
    @dr.unventor 4 года назад +43

    That’s so cool and useful

  • @Franschisco
    @Franschisco 3 года назад +4

    I like the way you share the coding process really cool to see your thought process during these

  • @Zynigma
    @Zynigma 3 года назад +1

    I love how quickly and efficiently you taught this. Subscribed

  • @jamedev1801
    @jamedev1801 3 года назад +3

    Loved this video man! Inspired me to do the same thing but in under than 24 hours, but yours was definitely much better! Keep it up man

  • @CamronJK
    @CamronJK 3 года назад +61

    I would love this in Animal Crossing

    • @junkeyz
      @junkeyz 3 года назад +5

      That's what I wanted to use this for, I was gonna make a 2D Animal Crossing game lol

    • @Jesse-um1pz
      @Jesse-um1pz 3 года назад +2

      @@junkeyz Great minds think alike, thats why im here haha

    • @junkeyz
      @junkeyz 3 года назад

      @@Jesse-um1pz Ha, nice!

    • @opal9583
      @opal9583 3 года назад

      @@junkeyz well, did you end up making it?

    • @opal9583
      @opal9583 3 года назад

      @@Jesse-um1pz did you end up making it?

  • @ZooperPlayz
    @ZooperPlayz 3 года назад +10

    Hey! This is really nice. Maybe add a few details to the character itself like if it’s rainy, he would open an umbrella. It it was sunny, probably sun bathing ;) or if it’s snowy make it so he’s wearing a sweater or a hoodie. That’s it! Nice vid as always!

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

    Good work dude! I used the darksky API for a school project, just made a little weather site

  • @vedrane0
    @vedrane0 3 года назад

    REST APIs can do really cool stuff, great video!

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

    I was wanting to make a smart mirror in VRC that displays users weather, time, and temperature so this is great!

  • @AmbarWasTaken
    @AmbarWasTaken 3 года назад +1

    Very usefull for the quarantine.

  • @Nicolonho
    @Nicolonho 3 года назад +1

    your content is simply amazing for me, even iam being brasilian and don't understanding many english coding terms.

  • @falxie_
    @falxie_ 3 года назад

    I like your unique ideas

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

    thanks for the video, it was helpful.

  • @gamerninjask6746
    @gamerninjask6746 3 года назад

    your videos are cool continue in your work

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

    No dislikes! Good job!

  • @aneesh1283
    @aneesh1283 3 года назад +12

    Amazing "this idea can be used many games"

  • @Todomo
    @Todomo 3 года назад +8

    i wish animal crossing used real world weather. kinda sucks when it’s a super nice day out but in my game it’s all dark and dreary, or the other way around- but i do see how in some places that would suck because they would never get rain

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

      they could do something like have a setting to turn it on and off to combat that

  • @mudokin
    @mudokin 3 года назад +13

    Thinking of futureproofing this, you could cut down on the requests by hosting your on server that buffers the requests,
    this obviously makes most sence if your game or app gets very big though ;).
    Also if your weather- or ipservice ever closes down you can easily switch to a different service.

    • @Cabalex
      @Cabalex 3 года назад +4

      Yup, because the Dark Sky API is going to be shut down by the end of 2021 :/

    • @chiefhydropolis
      @chiefhydropolis 3 года назад

      @@Cabalex RIP

  • @damid4557
    @damid4557 3 года назад +3

    how are you a small youtuber??? this is great!

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

    Fun fact: Animal Crossing City Folk was originally going to use a similar system, pulling data from the Forecast Channel, but they decided against it after they realized some players would get very samey weather, whether that be constant sunniness, constant snow, or even constant rain...honestly I'm surprised they didn't just go "Welp they can go visit their friends if they want different weather lol" but honestly I think an option for it would've been cool

  • @wolfboi8785
    @wolfboi8785 3 года назад +1

    Escape from Tarkov actually uses this concept. its also a unity game, and it uses the weather in Moscow to decide what the in game weather will be when players join a game. They also use it to change the price of in game bitcoins to give or take match the real world price aswell.

  • @flofdev
    @flofdev 3 года назад +1

    YES,this helped me so much, i want to make a app where your pc is affected by weather

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

      No.

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

      @@mibbleyt bruh

  • @ErtBaran
    @ErtBaran 3 года назад

    Good idea 👍🏻

  • @mr.fakeman4718
    @mr.fakeman4718 3 года назад

    Omg this is awesome

  • @dnspoofed
    @dnspoofed 3 года назад +106

    people in egypt: *left the chat*

    • @iceyberq
      @iceyberq 3 года назад +9

      *Sandstorm intensifies*

    • @luxraider5384
      @luxraider5384 3 года назад +4

      Imagine enabling earthquakes, eclipses and haze in a actual game

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

      @Ezequiel Ciamparella maybe me :)

    • @luxraider5384
      @luxraider5384 3 года назад +1

      @Ezequiel Ciamparella japan has about 1500 eathquakes a year. So they won t stop their life for a little earthquake

    • @phunweng962
      @phunweng962 3 года назад

      @@luxraider5384 We don't even know there's an earthquake when it comes.

  • @citrinesanimations
    @citrinesanimations 4 года назад +3

    niceee

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

    love this i was looking to have real time and date and make day cycle with sunrise and sunset data not sure how to find api or sites though

  • @maketolaughyou6402
    @maketolaughyou6402 3 года назад +1

    Good video Keep it up

  • @ounhy5359
    @ounhy5359 3 года назад

    this would be great for vr games

  • @KnightoftheSorryFace
    @KnightoftheSorryFace 3 года назад +14

    Instructions unclear, accidentally made it send hitmen to player houses

  • @otispeterson8152
    @otispeterson8152 3 года назад +11

    Pause on 1:36... Cloudy: snowy. Snow: clear-day. Sunny: cloudy. I figure you just mislabeled but thought it was funny

    • @BooleanCube
      @BooleanCube 3 года назад +1

      I just noticed that lol...

  • @hk5716
    @hk5716 3 года назад +4

    oh your that guy that makes videos by creating spaghetti code!

  • @eboatwright_
    @eboatwright_ 4 года назад +4

    how did you make that art in gimp?

  • @lonelyPorterCH
    @lonelyPorterCH 3 года назад

    Rest APIs, yeah, we also had to use them once at university ^^

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

    nice

  • @TheJas-vr2vr
    @TheJas-vr2vr 3 года назад +1

    Idea, take a random heightmap of somewhere on earth to use as terrain for a game.

  • @keanu_reeves
    @keanu_reeves 4 года назад +3

    Very interesting and cool Video!
    I really want to make something with the rest apis, but i cant find a webpage with a list of them.
    I saw, that you found a website or something (0:12), on which some apis are listed.
    So can you maybe post the link?

    • @thenewgameevolution5442
      @thenewgameevolution5442 4 года назад

      I might be hella late and you might have already found it, but the list is at github.com/public-apis/public-apis if you scroll down

    • @keanu_reeves
      @keanu_reeves 4 года назад

      @@thenewgameevolution5442 Thank you!
      And no I've not found the list before

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

    Polymars testing this be like. Rain come here. Right now.

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

    It would be cool if whenever it was raining/drizzing, the character would hold an umbrella

  • @user-co7do9nz9s
    @user-co7do9nz9s 3 года назад

    Good video, but can you give link to list of REST APIs wich you show at start?

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

    now this looks realistic...

  • @totallygrape9971
    @totallygrape9971 3 года назад

    grown 2k subs in one week!

  • @frosty7674
    @frosty7674 3 года назад

    Thinking about adding a Corona weather

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

    Is it secure, typing the API Key in inspector if I have to share the game with others?

  • @BojanVasilev
    @BojanVasilev 4 года назад +3

    it says "replace this with your API key" how can i replace it?

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

      Just register on the darksky website. After you sign up, it will give you the api key. Copy the api key and then go to Unity and paste the API key on the API key box on Unity.

    • @MasterGeorge090
      @MasterGeorge090 3 года назад

      ​@ilikeminecraft6753 gaming The maximum amount of weather requests are 1000 requests per day.

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

    also i think dark sky signups are disabled now.

    • @BaconStudio
      @BaconStudio 3 года назад

      Ikr. This has been my daily bruh moment :/

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

    OkMars

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

    2:20 if anyone sees this comment, if u ever plan on getting a client's ip for a project that you want to publish, make sure it is listed in your ToS that u r, there is some law behind it.

  • @hitoshilxrd4518
    @hitoshilxrd4518 3 года назад

    which text editor/ide you use for C#?

  • @Designguidetv
    @Designguidetv 4 года назад +7

    I really like this explanation, but I cant get it to work with openweathermap, mainly I think because the json has a lot more information about then next 48 hours, which id like to include.

    • @Designguidetv
      @Designguidetv 4 года назад

      i think its probably where to point inside that huge json file #beginner

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

    rip dark sky

  • @oscwavcommentaccount
    @oscwavcommentaccount 3 года назад +8

    4:11 That means you can request it every 1 minute 26 seconds.

    • @garrettrichards9028
      @garrettrichards9028 3 года назад +1

      MΛRTYNΛSPLΛYZ it would be more impressive if you showed your working out

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

      But it's literally just 24 hours divided by 1000, then just convert to minutes and seconds
      24 hours / 1000 = 0.024 hours = 1.44 minutes = 1 minute 26.4 seconds

    • @garrettrichards9028
      @garrettrichards9028 3 года назад +1

      @@MrMutebe But that's still more impressive than just saying the answer, even if it is still simple

    • @CreeperMan2254
      @CreeperMan2254 3 года назад +1

      Garrett Richards Are you a teacher or something

    • @ste.t
      @ste.t 3 года назад +1

      @@CreeperMan2254 lol

  • @farciarzfunny5326
    @farciarzfunny5326 3 года назад +20

    Btw the unity particle system is now a real thing

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

    Im having trouble making it work :(

  • @yunxiangchong226
    @yunxiangchong226 3 года назад

    Can you do a tutorial on how to get data from Google Fit in Unity?

  • @supersillystuffs
    @supersillystuffs 3 года назад +13

    Y'all ever heard of animal crossing?

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

    How about adding a new feature make the sky dark when it’s night time

  • @NewClearWinter2
    @NewClearWinter2 3 года назад

    Your new icon looks like it's from project arrhythmia

  • @SheepyIsSleepy
    @SheepyIsSleepy 3 года назад

    you should make this into a custom desktop background

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

      Yeah,even in Wallpaper Engine

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

    3:36 Just a little more complex... haha

  • @luxraider5384
    @luxraider5384 3 года назад

    Oh fck it s raining!!!! Lets plant smth!!!

  • @HugoMartinez-bj1xc
    @HugoMartinez-bj1xc 3 года назад

    do someone get any alternative solution, could someone share it ?

  • @Vallee152
    @Vallee152 3 года назад +1

    does the guy get worried if there's a weather advisory?

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

    I really like the format and pacing of this video, but it's missing something that I've been looking everywhere for... I don't know why, but the API i'm using has a lot of the apis containing a "data" object, which holds a lot of the information... This wasn't so big of a deal with most data objects i made, I made a special class that handled ALL data classes with the help of someone called ApiResponse and it contains a generic object for "Data". Buut for some reason one API has a DATA inside the DATA... It goes like, Odds {Data{ Id, name, Market{data{odds{data" This is incredibly confusing lol, how am i supposed to handle all these datas?! I tried making separate classes, but it doesn't seem to be populating them...

  • @doomjunyu_
    @doomjunyu_ 3 года назад

    Does it work for people using a vpn

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

    Now make a creepy text box appear that says "find shelter now" when the weather is tornado

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

    Hi Pocket Mars

  • @m_ibrahim990
    @m_ibrahim990 3 года назад +1

    Darksky api is no longer accepting new signup requests :(

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

    Can you please update it? Dark sky will be discontinued next year and you can no longer get api keys

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

    Wait he used Star Dew Valley as an example but I didn't know people still remembered that game.

  • @lovehansel
    @lovehansel 3 года назад

    Is the Dark Sky API detracted now that the app is down.

    • @noisehero4409
      @noisehero4409 3 года назад

      It's not really down, just the Android and Wear OS. But the API from what I can tell should be going down probably the end of 2021? Or I maybe just misinterpreted it

  • @roz9318
    @roz9318 3 года назад

    Rip Dark Sky

  • @jojoto147
    @jojoto147 3 года назад +1

    RIP Dark Sky API...

  • @leastexpected3115
    @leastexpected3115 3 года назад

    you can also use opensource project github .com/chubin/wttr.in for weather api, it's absolutely free

  • @Megagon10k
    @Megagon10k 3 года назад

    @PolyMars I am sure you probably know this by now but there is an easier way to get a users IpAddress :-)

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

    Try to make a game with scratch

  • @jaydonoobinactive5983
    @jaydonoobinactive5983 3 года назад

    But theres no snow in jamaica :((

  • @landenew
    @landenew 3 года назад +1

    im in arizona. so the weather would never change 😭😭

  • @rajeevjawaji4472
    @rajeevjawaji4472 3 года назад

    you could have just used ip-api.com/json/{ipaddress}?fields=status,lat,lon to only get the status, lat and long so you don't have to parse that much data

  • @mohammedsaad3801
    @mohammedsaad3801 3 года назад

    Every one use the wethet for helping thier country
    PolyMars: lets make a game

  • @noxious_nights
    @noxious_nights 3 года назад +1

    They need to add something like this to animal crossing pocket camp!!

  • @user-up7iz4zc7j
    @user-up7iz4zc7j 3 месяца назад

    So.. you're saying i can add the ISS to my game & have it relate to the actual location of the ISS.. great

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

    I just noticed that the player looks like a character from "Super Paper Mario." Heh.

  • @sheez-5486
    @sheez-5486 3 года назад +1

    waiting for rainy weather
    me who stays in International Space Station: Oh no

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

    it isn't possible to use it anymore

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

    cant create a acount

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

    Dark Sky no longer accepts new signups, that's a bummer

  • @boldey
    @boldey 3 года назад

    Dark sky is shut down :c

  • @DrewCoop30
    @DrewCoop30 3 года назад +1

    Hi

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

    This in Minecraft.

  • @myfirerescue1965
    @myfirerescue1965 3 года назад

    karen screaming intesifies

  • @gbgaming7724
    @gbgaming7724 3 года назад

    You should make this in minecraft

  • @teu009
    @teu009 3 года назад +1

    im glad that farming games dont work like that, cuz if they did, it would be impossible to play them on arizona

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

    I really hope that these aren't the categories 1:35