This is fantastic and should be part of the official unity documentation since it's a bit hard to follow.
@flynnwells27133 жыл бұрын
I know Im kind of off topic but do anybody know a good website to stream newly released series online ?
@emiliozahir34273 жыл бұрын
@Flynn Wells Flixportal :D
@flynnwells27133 жыл бұрын
@Emilio Zahir Thanks, I went there and it seems like they got a lot of movies there :D Appreciate it !!
@emiliozahir34273 жыл бұрын
@Flynn Wells Happy to help :D
@haachamachama73 жыл бұрын
Man, Unity always does this... They make these amazing, powerful features... That are at times both, difficult to use and clunky haha. Like the localization, it's amazingly powerful and useful, but there's so many weird aspects about it, and it's very difficult to understand at first... Sometimes... it feels like they rely on tutorial writers to help people out lol
@chrisstrauss72883 жыл бұрын
I was looking for a solution to this problem ...and I came across this video. Many thanks ! God bless
@CodeMonkeyUnity3 жыл бұрын
I'm glad the video helped you! Thanks!
@ShawnRay Жыл бұрын
Can you make a tutorial on how to send javascript functions through an ? I'm using simmer to host my games and I would like to click a button and send this into the
@mohamedmostafa-ri8fn7 ай бұрын
thank you very much, I always find the solution to my problem in your channel
@CodeMonkeyUnity7 ай бұрын
Nice! I'm glad my videos have helped you!
@F3ND1MUS5 жыл бұрын
merry christmas, ty for this
@SowedCastelli5 жыл бұрын
You are the realest MVP 🙏. Thank you.
@vortexgames7445 жыл бұрын
Can you do user generated content with uploading
@subramanyam26993 жыл бұрын
Very useful tutorial indeed.
@nathanrona35603 жыл бұрын
Thank you, I'll use this to get data from BLE (Bluetooth low energy) sensor to unity game using the Javascript WEB-BLE API.
@giuseppemastrolonardo61002 жыл бұрын
Hello. Congratulations on your videos are great. I tried to redo this example in my game but I noticed that in the INDEX they changed the string of var = unityInstance ..... they deleted it. How can I do now? Thanks
@GameDevDave4 ай бұрын
This dude types fast man, holy sh*t
@peny19815 жыл бұрын
WebVR, WebXR will be better supported ?
@nicolasportu2 жыл бұрын
Hey! How to sync float range slider from js to to Unity? Thanks
@Javascript15 жыл бұрын
Thanks for this video. I was expecting you to give some examples how to call js from our C# script... I'm using Application.ExternalCall now, but it is absolete in the most recent unity version.
@CodeMonkeyUnity5 жыл бұрын
According to the manual the recommended way is to add your js file in your plugins folder docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html
@josimarakpomudia193 Жыл бұрын
Is there a way i can communicate from flutter webview application?
@melisaozen48973 жыл бұрын
Amazing tutorial, but unfortunately "unityInstance" creates an error in my project. Can't get the work done, thanks anyway!
@rikiahmad23 жыл бұрын
How to send data on Scene Loaded trigger, not by button ?
@danielconde0013 жыл бұрын
saved my skin! thank you!
@davidoshin8708 Жыл бұрын
thanks so much that worked
@jatingoel48202 жыл бұрын
Hi, I want to pass userId in webgl build whenever user login in website so Unity WebGL get that userid string value in my unity code?
@jackgunderson8702 жыл бұрын
Awesome video --I'm able to make the changes to the colors no problem, but when I try to pass a number or a string with the function I get "Cannot read properties of null (reading 'Send Message'). Any suggestions? I've tried on my own project, and then used your exact project files.
@dariogarcia51633 жыл бұрын
how would it be the inverse, receive data from javascript to unity?
@se5d Жыл бұрын
can you post that index.html final file? for some reason buttons is not working
@armandocomellas96392 жыл бұрын
Hello bro, thank for the tutorial, l have a question and how do you do viceversa? from Unity yo JavaScript?
@TheRobochicken54943 жыл бұрын
omg thank you so much for this
@DaElfer3 жыл бұрын
the PHP one is messing me up. Im trying to pull information from a mysql database with PHP and need to POST to the PHP. Normally this is no problem in anything except WebGL. None of the sites i have been to seem to have a good concise answer
@julianbergeret9823 Жыл бұрын
where do you open the java script?
@CodeMonkeyUnity Жыл бұрын
What do you mean by "open"? Javascript runs in the browser
@apubetico5 жыл бұрын
finally heree!
@rathodketan55512 жыл бұрын
how to save file into player local machine ? in webgl
@돌림정4 жыл бұрын
is it possible with c# winform program without java/php?
@RobertGercia2 жыл бұрын
Hi, I am new to game development. Just wondering, between Unity and Unreal, which is possible to do such task as this: User input email address, on submit button, the game capture screen shot and send the image to the email. If there such beginner friendly tutorial on this, please take us there. By the way, great content as always. Everyday I learnt something new.
@CodeMonkeyUnity2 жыл бұрын
I covered how to do an HTTP call here kzbin.info/www/bejne/fZyTXpSjm9Noeq8 And a screenshot here kzbin.info/www/bejne/mmbRdoGlhrNnitk Combine both of those and you can take a screenshot and send that data through HTTP to whatever server you have
@RobertGercia2 жыл бұрын
@@CodeMonkeyUnity thanks for the reply. really a great help!!
@granadaburak35084 жыл бұрын
I used Application external call call js html from unity how can i do now ?
@unityDev20242 ай бұрын
I have a question, Can I display adsense ads in unity webgl games? if I want to show rewarded ad
@CodeMonkeyUnity2 ай бұрын
Yes you can use Unity Ads or Admob, same as for mobile
@unityDev20242 ай бұрын
@@CodeMonkeyUnity search this "admob in webgl" and click on first link which is , from google help Can I use Admob for monetization in WebGL based Game? the answer is no in this blog , so if you know the correct answer please reply
@yogesh00parihar Жыл бұрын
Can we do this - pass a string from unity to javascript
@CodeMonkeyUnity Жыл бұрын
You can define and call the functions directly docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html Or you can do an HTTP request unitycodemonkey.com/video.php?v=Gk0-amfn5DM
@merabet.faycal Жыл бұрын
Can you please explain if any have an idea about this error am getting in the log console SendMessage: object JavascriptHook does not have receiver for function "function Name" even tho the function names are identical in both c# and js scripts AND am passing string value
@CodeMonkeyUnity Жыл бұрын
Sounds like you're passing in the string "function Name", perhaps you're passing in a javascript object and not a string
@merabet.faycal Жыл бұрын
@@CodeMonkeyUnity you are correct, that was happening to me thank you for your reply ! i have got it figured out, now am struggling on how to call a function that is out in my script by pressing a button UI so that function can get data from a server and them SendMessage back to unity player with the fetched data. The part am stuck with is calling a javascript function. can you please explain or set an example if possible ?
@thaboseane5024 жыл бұрын
Is it possible to call a webpage into webgl
@StefanLopuszanski3 жыл бұрын
What about sending data to Unity WebGL from a Unity desktop build running on the same computer?
@jondyason3362 жыл бұрын
Thank you!!
@mayankkashyap40594 жыл бұрын
Inside the SendMessage, when we type in the function name, how do I write a function name which accepts 2 parameters, like - Func(string s1, string s2) ??
@omaramen58553 жыл бұрын
you can pass Json object that contain any amount of data
@FPChris3 жыл бұрын
Can you remove the Unity logo stuff below the game window and position and resize the game window in the page?
@atharvasawarkar90863 жыл бұрын
yes change the index.html accordingly
@lamloy95075 жыл бұрын
Can you make 2D foot ık? Like the 3D.
@CodeMonkeyUnity5 жыл бұрын
I'm not familiar with any specific tool but yes I'm sure there are IK solutions in 2D
@sarathnookala90182 жыл бұрын
Hello, Can you explain about payment gateway integration for webgl platform. That could be helpful
@RiderForge4 жыл бұрын
Can I send data back to the website from Unity? I want two-way communication so I can ultimately access a MySQL database and save data. I know how to do the database stuff in PHP but we need two-way communication. Can we send json back?
@CodeMonkeyUnity4 жыл бұрын
Sure, you just do a Web Request on the website as if accessing a normal link kzbin.info/www/bejne/fZyTXpSjm9Noeq8
@jabrailchumakov Жыл бұрын
Hi! Thanks for the tutorial. I have an error saying that "caught ReferenceError: unityInstance is not defined". How can I fix it? After I build my project I also don't have unityInstance var as you. It only appears at the end like this " var script = document.createElement("script"); script.src = loaderUrl; script.onload = () => { createUnityInstance(canvas, config, (progress) => { progressBarFull.style.width = 100 * progress + "%"; }).then((unityInstance) => { loadingBar.style.display = "none"; fullscreenButton.onclick = () => { unityInstance.SetFullscreen(1); }; }).catch((message) => { alert(message); }); };" I will appreciate any assistance!
@CodeMonkeyUnity Жыл бұрын
It's possible they changed the name in the generated javascript code in recent Unity versions, look in the source code to see what name they used
@pianosouls_yt Жыл бұрын
did you fixed it :v i need your help thanks
@jabrailchumakov Жыл бұрын
@@pianosouls_yt Hi! Yes, you just need to redefine the unity instance to your custom name and then refer to your custom instance.
@aqibahmed340 Жыл бұрын
Reference code plz??@@jabrailchumakov
@kpm25 Жыл бұрын
@@jabrailchumakov Yep I had the same issue.. I defined like this if anyone comes across the same error: script.onload = () => { createUnityInstance(canvas, config, (progress) => { progressBarFull.style.width = 100 * progress + "%"; }).then((unityInstance) => { myGameInstance = unityInstance; loadingBar.style.display = "none"; fullscreenButton.onclick = () => { unityInstance.SetFullscreen(1); }; }).catch((message) => { alert(message); });
@LouieLu-pz9bj Жыл бұрын
I'm currently trying to create a project using this method. However, I can't understand how you manage to run Unity and html on local host, especially on the same web page. So I don't really know how to test the codes like the video described. Can you provide a video or a link to this kind of tutorial?
@CodeMonkeyUnity Жыл бұрын
Not sure what you mean, you just open the .html file as usual, only thing that doesnt work like that is some server code like php, fir that you need a webserver
@LouieLu-pz9bj Жыл бұрын
@@CodeMonkeyUnity Thanks for replying! I'm using XAMPP to run html on local host, so I was wondering if you are using the same or different way to test your html file. If so, do you put the Unity folder (index.html) under the same folder in XAMPP? I think it may be a small and simple step, but it's crucial for me that I need to know it so that I can test this code. Currently I couldn't any other video tutorial relating to SendMessage(), lol.
@shalsa074 жыл бұрын
Wow. Great tutorial as always, serious fun. I learn a lot from your tutorials. How would u go about opening a website within a webgl build without opening it in a new tab
@CodeMonkeyUnity4 жыл бұрын
For that you need some complex way of rendering a webpage inside Unity, I think there are some assets on the Asset Store that do that
@shalsa074 жыл бұрын
@@CodeMonkeyUnity wow. Thanks for the prompt response. I realized that how complicated it might get through my research. Can't seem to find any that support webgl. Could please share any recommendations? I keep finding for other platforms but webgl
@WoodCat-k3b Жыл бұрын
"I used your method, but the button I wrote in the HTML cannot trigger my Unity function. I have tried many times but still cannot make it work. Can you please tell me what I did wrong?"
@DutchyChannel2 жыл бұрын
Am I right to understand that with php/mysqli I could only store and retrieve data on command? I have a webserver online somewhere which only allows me to use php/mysqli as far as I get it (not experienced with this stuff at all). I figured out how to store and retrieve data with php/mysqli through Unity already. However, I am trying to see if I can do some sort of multiplayer with this as well. For example a chat, or say a live 'voting' system for something (bit of latency not being a problem). I found NodeJS is often used for this but it seems my webserver doesn't allow for this and now I'm trying to find an alternative. Any tips or advice for me, please?
@CodeMonkeyUnity2 жыл бұрын
For any serverside logic you can just do a regular HTTP request from Unity. unitycodemonkey.com/video.php?v=Gk0-amfn5DM So for a chat system your Unity build would do a HTTP request every X amount of seconds, then in your server the PHP would go to the database, grab the last chat messages and return that.
@giblotskii6595 жыл бұрын
I opened the video and your ad appeared 3 times😂
@Neltor4114 жыл бұрын
Thanks for the Video! Very helpful. When trying to use the PHP code, I get an "Unexpected token '
@CodeMonkeyUnity4 жыл бұрын
Is the file saved as .php? Do you have PHP installed in your webserver? Try both the short hand
@EGL-P3 ай бұрын
Please create a video for setting up and using Firebase services (Auth, Realtime Database, Firestore, etc) with Unity for WebGL. The Firebase SDK for Unity doesn't support WebGL however there are old videos (uNicoDev) that show how it can be achieved, that are now outdated and no longer work.
@GiantsOnTheHorizon3 ай бұрын
The Coco3D channel has some videos on Firebase Authentication.
@I_SeriouSaM_I2 жыл бұрын
Hi, I m making a WebGL game and i want to host the game in a sever and would need to be able to webgl to connect to that server. How can i do that? TY
@CodeMonkeyUnity2 жыл бұрын
Pretty sure you can do a regular HTTP request unitycodemonkey.com/video.php?v=Gk0-amfn5DM
@I_SeriouSaM_I2 жыл бұрын
@@CodeMonkeyUnity Thank you man 😍
@tsunderenekokun5 жыл бұрын
Do you take requests?
@sutharsanny18054 жыл бұрын
Will this work even if we hosted the game container on remote CDN server?
@smileychess3 жыл бұрын
Since the game container is running in the browser, it shouldn't matter where it's hosted.
@TaninoMiao4 жыл бұрын
Every time I re-build the project the index.html file is deleted and replaced with a new one. Is there a way to maintain the index file with all the modified content?
@CodeMonkeyUnity4 жыл бұрын
Don't think so, that's why normally I don't build directly into the server folder.
@mmartomacgaming19393 жыл бұрын
@@CodeMonkeyUnity So how do you do it??
@CodeMonkeyUnity3 жыл бұрын
@@mmartomacgaming1939 Build it onto a folder then copy just the assembly files. index.html just contains the interface, all the unity stuff is inside the folder.
@mmartomacgaming19393 жыл бұрын
@@CodeMonkeyUnity Idk what you mean. The only html file i have is the index one which i can't edit?
@emanueltejadacoste22505 жыл бұрын
Please make a course about how to create a complete game in unity on udemy 😊 pleaseeeee i think your subs will love to buy it
@CodeMonkeyUnity5 жыл бұрын
I would like to one day do some complete premium courses but they take a long time to make right so not sure when
@ruanxun94544 жыл бұрын
I think code monkey is a god of making short tutorials. There are different types of KZbinrs and I am sure you will find one who loves making long tutorials.
@emanueltejadacoste22504 жыл бұрын
ruan xun yey 😢
@joshreaver6042 жыл бұрын
Sorry to ruin the '69' comments by adding another but do you have an updated version of this that would work with the new way Unity creates WebGL builds as it now creates 4 files instead of 6 and instead of Build.json its a .wasm and using the script in this video says 'cannot find unity loader'. So I assume there must be a way its just not whats in this video.
@superciasadmin Жыл бұрын
Josh. Did you find a way to work with the Unity 2020 build or higher?
@loldude82382 жыл бұрын
Is it possible to embed my unity game to my website?
@CodeMonkeyUnity2 жыл бұрын
Yes you can make a WebGL build
@rapcostard81554 жыл бұрын
Hi ! i'm trying to put a video inside of a game on web gl on Itch.io... could you make a video about this ? thanks a lot!
@CodeMonkeyUnity4 жыл бұрын
Check out the VideoPlayer component
@tigransahakyan28405 жыл бұрын
Still waiting for archer video :)
@tomekipro1687 Жыл бұрын
i hope you show in another direction too.
@CodeMonkeyUnity Жыл бұрын
Send from Unity to a webserver? That's just a HTTP request unitycodemonkey.com/video.php?v=Gk0-amfn5DM
@adwaithks4 жыл бұрын
Can values be returned from unity c sharp file, to html, for JavaScript to modify it??
@nathanrona35603 жыл бұрын
See "Calling JavaScript functions from Unity scripts" in manual docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html
@Michal0055 жыл бұрын
First
@danieldeleon54594 жыл бұрын
No aprendió porque todavía dice: "Couch", lo correcto es "Entrenador".
@Sampza125 жыл бұрын
Why couldn't you just make the buttons in Unity
@CodeMonkeyUnity5 жыл бұрын
Because the whole point is to pass data from Javascript into Unity. So for example you can make a SQL query, grab some data from your database and send it to Unity to visualize it.
@Sampza125 жыл бұрын
Thanks I think i understand it now a little better
@GardenOverflow3 жыл бұрын
Really useful , Thank you so much. i don't any web programming skill, but recently, I participate an art project and it need to submit a website with my unity webgl embeded in, so I upload my game on itchl.io and embed it on website I built by WIX. I hope to ask, is there any possible to send message like your tutorial in these website which built by wix? any helps will so appreciate, Thank you