Download Data/Images from inside Unity (HTTP WebRequest)

  Рет қаралды 38,510

Code Monkey

Code Monkey

Күн бұрын

Пікірлер: 112
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Add external connections in your game with this simple class! Check out the Widget in action inside Battle Royale Tycoon store.steampowered.com/app/851930/Battle_Royale_Tycoon/
@mahado-limited
@mahado-limited Жыл бұрын
what should i modify if i want to download a unity packaje instead of textures to unity from the file explorer?
@alexhogenson1799
@alexhogenson1799 Жыл бұрын
Thank you so much for this. I was pulling my hair out trying to find articles on how to web scrape from Unity. Watched your video and had a working model within minutes. THANK YOU
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
I'm glad the video helped you! Thanks!
@andersencastaneda6080
@andersencastaneda6080 4 жыл бұрын
didn't know about delegates, but thanks to you now I see the utility. Your videos are amazing. Thank you
@SaiCharanKommana
@SaiCharanKommana 4 жыл бұрын
Just what I was looking for
@mehmedcavas3069
@mehmedcavas3069 4 жыл бұрын
Sai Charan Kommanna same xD
@mehmedcavas3069
@mehmedcavas3069 4 жыл бұрын
Lol. Im doing the same thing for my graduation project. But I couldnt find a good unity tutorial so I had to started it with android 😅
@mehmedcavas3069
@mehmedcavas3069 4 жыл бұрын
@alex noah hahaah heyyyyyy :-D I'm always here and at other places. I have nothing to do :D
@mehmedcavas3069
@mehmedcavas3069 4 жыл бұрын
@alex noah hahaah yes. And even if u don't use the things its always interesting to see how they solve or program these things so I can use it at similar things or when I want to do it later :D
@lephobix
@lephobix 3 жыл бұрын
Great I've been looking around for this for days! Thx a lot!👌😁
@sathvikreddy1407
@sathvikreddy1407 2 жыл бұрын
Saved me a bunch loved the video...it showed me how much more i need to learn.....thanks
@JoBader
@JoBader 4 жыл бұрын
very good video. would like to see more of that for example about uploading to steam workshop from inside unity
@kken8766
@kken8766 4 жыл бұрын
thank you thank you thank you. Thank you for this great tutorial. btw how do you maneuver so fast in the editor? A lot of your mouse clicks are like control by your mind telepathically.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Heh it's all about experience, I've been using Unity for 7 years now and writing code for a lot longer. So just keep at it!
@TheLucidKitty
@TheLucidKitty Жыл бұрын
You sent me to this video to figure out how to incorporate YT live chat into live streams through Unity and it worked so thank you as it took me a month of failing to find good resources to figure it out. Now im just trying to automate the connection process a little more as I currently have to use the api developer console to pull the livechatid from the livebroadcast list but cant seem to do that in Unity. I keep getting a 401 unauthorized.
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
For getting the LiveChatId you need to be signed in, it doesn't work just with the API key, it needs OAuth
@TheLucidKitty
@TheLucidKitty Жыл бұрын
@@CodeMonkeyUnity I suspected that which brings in the problem of knowing where to put the oath and how to properly generate one. Is there a straight forward way of doing it?
@TheLucidKitty
@TheLucidKitty Жыл бұрын
for example I got it all the way where the browser asks me to log in but after choosing the right account, the redirect seems to fail no matter what I try
@tigransahakyan2840
@tigransahakyan2840 4 жыл бұрын
Please make some tutorial for standart c# interfaces and their usage. You showed idisposable and would be great to see some others too. Thank you.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Yup a complete C# course is definitely something I'd like to cover at some point.
@tigransahakyan2840
@tigransahakyan2840 4 жыл бұрын
@@CodeMonkeyUnity thank youuu
@micaiahstevens8840
@micaiahstevens8840 4 жыл бұрын
SHOULD be noted, as a perfectionist you CAN do a .. 'IEnumerator Start()' and Unity recognizes and calls it as such.
@micaiahstevens8840
@micaiahstevens8840 4 жыл бұрын
LOVE the idea of this, but beyond what your doing, HARD to imagine ideas. I haven't done much with Web stuff, but would LOVE to do more. I even though wouldn't it be cool to do some discord things. STILL waiting on your KZbin test game implementation, that was a FUN experience.
@micaiahstevens8840
@micaiahstevens8840 4 жыл бұрын
SAD I was all like Meh meh MEH Code Monkey isn't going to use TextMeshPRO and I will I'll SHOW him. (I can't see your white text) just assumed. TURNS out TMPPRO does NOT like webpages in its text field, but Text - good ole Code Monkey stand by was happy. I get severals logs saying width and tags are invalid. 2019.3 latest.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Oh interesting, didn't know you could easily Coroutine Start(); I definitely want to continue making that live chat game, hopefully soon.
@457Deniz457
@457Deniz457 4 жыл бұрын
:OOOOO Awesome ! :) Thanks :)
@tomicooltomi
@tomicooltomi 4 жыл бұрын
Great video. Instead of coroutines would you be able to run the request code inside an async function and use the await keyword? This would remove the need for coroutines.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Yup that would be the pure C# way of doing it. I'm still not too familiar with async/await so that's why I stuck with simple Coroutines.
@nokiyo8609
@nokiyo8609 3 жыл бұрын
Can you make a video of how to extract or obtain the images and sounds of games in .data.unityweb? please
@MGConstantin
@MGConstantin 4 жыл бұрын
When will you create a tutorial about Networking ? (multiplayer)
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Whenever Unity releases the new Multiplayer stack.
@SubjektDelta
@SubjektDelta 4 жыл бұрын
Can you do a tutorial on asset bundles? It would be like this but even better!
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
I've done some research into Asset Bundles and it's definitely something I'd like to look into some more, never used it personally.
@peterquill726
@peterquill726 4 жыл бұрын
@@CodeMonkeyUnity If you are going to do Asset Bundles video, please do Adressable instead.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
@@peterquill726 Yup that's what I was researching, seems very interesting
@andersencastaneda6080
@andersencastaneda6080 4 жыл бұрын
@@CodeMonkeyUnity You are the Best
@GeospatialTechnologies
@GeospatialTechnologies 3 жыл бұрын
Hi, How can I open a website URL from an image marker using ARCore in Unity? I am trying to build an AR app using ARCore in Unity. I have ten images and ten url links to websites, I need to link the ten images with those ten url links. When I scan the image with the phone's camera, I want the URL to open directly. I've done image tracking with video before, but now I want to do image tracking linking to a URL. Do you know any tutorial to follow it? Thank you!
@theplaymakerno1
@theplaymakerno1 3 жыл бұрын
I wish I could support you man
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
You're supporting by watching! I'm glad you like the videos!
@RickoDeSea
@RickoDeSea 4 жыл бұрын
Love the tutorial.
@youssefsallak3339
@youssefsallak3339 2 жыл бұрын
Can you explain to us how to download videos from social media? Thank you
@GamerXPlayz
@GamerXPlayz 4 жыл бұрын
Nice code
@JadenAllen
@JadenAllen Жыл бұрын
so ive got it working although theres a slight issue im running into. Id like for all the images to get downloaded and not just the ones on the first page. I checked and cant seem to find out how to get the other images to download. When i go to the next page it doesnt actually take me to a new link meaning i cant just add a new link for each 8 images. Has anyone experienced this problem? Im using a wix website and im assuming its something to do with how they display the images and hide the ones for the "next" page
@viratgangurde
@viratgangurde 4 жыл бұрын
Thank for nice code explanation. I have question while loading image or video from internet / Apache server , could you add waiting / progress bar. Just like switching between two scenes. Or any other option do you have to intimate user that some process is going on for loading image/video. Thanks in advance.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
SendWebRequest(); returns a UnityWebRequestAsyncOperation which you can use to access progress
@shahriyor_m14
@shahriyor_m14 Жыл бұрын
Очень полезный урок. Не могли бы вы сделать урок насчёт кэширование
@NoName-vg9hf
@NoName-vg9hf 4 жыл бұрын
And how can you grab variables, that way we could find if someone for example paid some item in steam for the game and then we add it to the player's game
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
That depends on whatever back end you're dealing with, this is just grabbing data, it's up to you what that data means. You can store player data in your own server and do a simple GET request where the server checks the database if the player has a certain item.
@NoName-vg9hf
@NoName-vg9hf 4 жыл бұрын
@@CodeMonkeyUnity ah ok, but it was more for a way to sell for example weapon in my game, that you can purchase on steam. I think something like counter strike
@AmanKumar-tu2og
@AmanKumar-tu2og 4 жыл бұрын
Really helpful! Thanks a lot. How can we cache the data downloaded from the web using webrequests? I know File.WriteBytes can be used, but then how can we check that is the file outdated or not?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
To check if your data is outdated you really have to ask the server again, maybe the server can have a simpler function that returns the time of the last change.
@relentingVids
@relentingVids 2 жыл бұрын
I imagine this could fetch data for displaying info and images about NFTs within Unity. It’s going to be pretty sweet seeing where game development goes from here with blockchain integration! Also as always thanks for sharing your knowledge!!!
@GamerXPlayz
@GamerXPlayz 4 жыл бұрын
Can you show me How To set character in unity
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
What do you mean by "set character"?
@micaiahstevens8840
@micaiahstevens8840 4 жыл бұрын
If I was to venture a guess: you get the string data of the character, and use a Json.Override to overwrite a character class. OR player or whatever. This works with SO and pretty much uses a webrequerst instead of a file read. I Was thinking Scriptables which use Override, you can just use a Json.FromString or something see Json Tutorials.
@GamerXPlayz
@GamerXPlayz 4 жыл бұрын
@@CodeMonkeyUnity look at my channel video I give picture of character
@GamerXPlayz
@GamerXPlayz 4 жыл бұрын
@@CodeMonkeyUnity this kzbin.info/www/bejne/paGzm62wlsybetU
@GamerXPlayz
@GamerXPlayz 4 жыл бұрын
@@micaiahstevens8840 There are so many body pieces that one will know how to shave
@lanceroygames
@lanceroygames 10 ай бұрын
So I'm still a bit of a newbie when it comes to programming in Unity. So its my first time encountering writing and using delegates. Codemonkey said that it makes it easier to use the function? But it seemed easy to use it before implementing the delegates. Also using a Static Class instead of Monobehavior, I'm not sure what the benefit of this was as well. If someone could explain with some examples, I would be grateful.
@CodeMonkeyUnity
@CodeMonkeyUnity 10 ай бұрын
Are you talking about the lambdas? If you use lambda functions you can just define the delegates directly when calling the function, much simpler than having to define a whole separate function just to handle the callback. Making it a static class makes it really easy to call those functions from anywhere in the codebase, you don't need to worry about initializing any object, just call the static function and it works.
@lanceroygames
@lanceroygames 10 ай бұрын
@@CodeMonkeyUnity ah I see. Thank you. Yeah that pretty much answers my questions. I'm going to have to practice this implementation to completely grasp it but I understand the concepts now. Thank you.
@omiorahman6283
@omiorahman6283 2 жыл бұрын
Code Monkey I used UnityWebRequest. Post to access image from online. which uses image text to add custom image into the game. UnityWebRequestTexture. GetTexture( ) and Texture2D is used. is there any way to make this safer. using http the user can add custom image from both the web and Pc but how to improve the security of webRequest? also i used unity 2018
@NewbNinjas
@NewbNinjas Жыл бұрын
Why does it keep jumping while scrolling?
@emascheg
@emascheg 4 жыл бұрын
Do u have psycho power?. just like others was for the same theme.
@theashbot4097
@theashbot4097 Жыл бұрын
Hey I am getting this error: "Coroutine 'SpeakSentence' couldn't be started!" Could you help me? (Speack Sentence is my Coroutine).
@theashbot4097
@theashbot4097 Жыл бұрын
Never mind I got it to work. I had my code like this ```C# gameObject.StartCoroutine("SpeakSentence"); ``` then I change it to: ```C# gameObject.StartCoroutine(SpeakSentence()); ```
@Non3
@Non3 3 жыл бұрын
Do you know how to do a loading screen with the percentage of data that is loading from a database? :(
@jfiascaro
@jfiascaro 2 жыл бұрын
How can we send the secret and public keys for security connection?
@ophelia6044
@ophelia6044 2 жыл бұрын
Thanks a lot!
@wilsonandia8290
@wilsonandia8290 2 жыл бұрын
Hello AND ty for videos, y I dowloand a videoPlay and save it in my local data its posible?? I search in Google but there isnt information
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
On the VideoPlayer component you can set a URL. Or you can use this to download a byte[] of your video, then save that byte[] to a local file and play that file in the VideoPlayer URL with file://
@menti9980
@menti9980 3 жыл бұрын
Do you think it's possible to download a .zip folder using this? I'm creating a game launcher which downloads the games from a google drive link but I can't get it to work
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Sure, it's just downloading bytes so it will download anything. Might have issues if the file is too big and the connection drops halfway though.
@rafaelcorrea7959
@rafaelcorrea7959 4 жыл бұрын
Doesn't steam have an restless API that could be used? Downloading the entire HTML seems a little overkill...
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
They have a bunch of APIs but don't think there's one that returns items in a collection. At least there wasn't back when I first made the Workshop Showcase.
@pourmydrank
@pourmydrank 2 жыл бұрын
So this is how VR Chat and Roblox works?
@hanifcraft2546
@hanifcraft2546 3 жыл бұрын
good advertisement until i got in here
@SaiCharanKommana
@SaiCharanKommana 4 жыл бұрын
Is there a way we can download the images and save them in the project to be used later on when we run the same application next time? In this case, every time I open a web request is sent and data is taken from the site. But can we have it like once we get the images, can we download them and save it in the project to be accessible for later time without requiring to send a new request?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Sure just do File.WriteAllBytes(); to save it onto your disk
@SaiCharanKommana
@SaiCharanKommana 4 жыл бұрын
@@CodeMonkeyUnity I tried this out, but I'm getting a red question mark when trying to save the texture.
@kaan1780
@kaan1780 4 жыл бұрын
at 4:55 if I set it to TextMeshPro, I can't drag my text object, I have to set it ti TextMeshProUGUI. Just leaving this comment for those who might also have the same problem
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
It depends on which type of text object you use. In the video I used the normal one placed in the scene instead of a UI Text object.
@cpcaraho7046
@cpcaraho7046 3 жыл бұрын
I have a problem
@jonasvirsila4179
@jonasvirsila4179 3 жыл бұрын
What if I want to add the texture to the GameObject material?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
material.mainTexture = myTexture; or material.SetTexture();
@Sarv9208
@Sarv9208 2 жыл бұрын
¿Cómo hago que espere hasta que cargue la textura? mi juego permite mover el personaje sin cargar la imagen? How do I make it wait until the texture loads? my game allows to move the character without loading the image?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Maybe just make a black image in the UI with some "Loading" text and then hide it after the image is downloaded
@SpookieD00kie
@SpookieD00kie 3 жыл бұрын
Can you use this to grab google image results?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
You can download anything so yes
@MomoVader
@MomoVader Жыл бұрын
yeeeyyyy:) thx
@MatthewKrekeAuthor
@MatthewKrekeAuthor 3 жыл бұрын
can you do this with online videos?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Do what? Download? Yes if you have a URL you can download it
@MatthewKrekeAuthor
@MatthewKrekeAuthor 3 жыл бұрын
@@CodeMonkeyUnity I keep getting this error: WindowsVideoMedia error 0xc00d36c4 while reading kzbin.info/www/bejne/fZyTXpSjm9Noeq8&lc=UgxiBpHINufJPd0Q6rd4AaABAg.9G0-WxWvIjb9G05Ol7O6I2.mp4 Context: MFCreateSourceReaderFromURL Error details: The byte stream type of the given URL is unsupported. Track types:
@SneakySSS
@SneakySSS 4 жыл бұрын
Upload a Unity tutorial pls :/
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
What do you mean? All my videos are Unity Tutorials.
@sabrango
@sabrango 4 жыл бұрын
thx!
@arsethtgp704
@arsethtgp704 2 жыл бұрын
light mode burn my eyes ;-;
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Sorry but dark mode burns mine
@ASMRcu
@ASMRcu 4 жыл бұрын
Amazing...
@aggressivemastery
@aggressivemastery 4 жыл бұрын
HAWT!
Turn-Based Combat in Unity
29:40
Brackeys
Рет қаралды 576 М.
Magic or …? 😱 reveal video on profile 🫢
00:14
Andrey Grechka
Рет қаралды 79 МЛН
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 1,2 МЛН
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26
What are Subscenes in Unity? (Massive Worlds!)
15:51
Code Monkey
Рет қаралды 95 М.
20 Advanced Coding Tips For Big Unity Projects
22:23
Tesseract
Рет қаралды 183 М.
The Internet Played My Game (and it did not go well)
9:27
advancenine
Рет қаралды 246 М.
Best Practices for fast game design in Unity - Unite LA
46:16
How One Programmer Created Gaming's Most Complex Ecosystem
28:29
ThatGuyGlen
Рет қаралды 1,6 МЛН
Переходишь с Unity на Godot? Посмотри это видео!
25:19
Тот Самый Келин
Рет қаралды 114 М.
Learn to Code or Game Design? Which is better? (and why?)
21:58
Jason Weimann
Рет қаралды 725 М.
Simple Drag Drop (Unity Tutorial for Beginners)
10:31
Code Monkey
Рет қаралды 325 М.
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 227 М.
Smooth PORTALS in Unity
24:53
Brackeys
Рет қаралды 455 М.