How to Send Data to Unity WebGL from Javascript or PHP

preview_player
Показать описание
Let's check out how to send Data from Javascript/PHP into a Unity WebGL build!

Unity Manual, Interacting with Browser Scripting

How to create a Graph in Unity

What is JSON?

Simple Saving and Loading with JSON to a File

If you have any questions post them in the comments and I'll do my best to answer them.

See you next time!

#unitytutorial #unity3d #unity2d

--------------------------------------------------------------------

Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.

I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.

--------------------------------------------------------------------

Рекомендации по теме
Комментарии
Автор

I was looking for a solution to this problem ...and I came across this video. Many thanks ! God bless

chrisstrauss
Автор

This is fantastic and should be part of the official unity documentation since it's a bit hard to follow.

MikeMinneman
Автор

Thank you, I'll use this to get data from BLE (Bluetooth low energy) sensor to unity game using the Javascript WEB-BLE API.

nathanrona
Автор

You are the realest MVP 🙏. Thank you.

SowedCastelli
Автор

Please make a course about how to create a complete game in unity on udemy 😊 i think your subs will love to buy it

emanueltejadacoste
Автор

Can you do user generated content with uploading

vortexgames
Автор

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.

joshreaver
Автор

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

DaElfer
Автор

"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?"

WoodCat-kb
Автор

Hi, I want to pass userId in webgl build whenever user login in website so Unity WebGL iframe get that userid string value in my unity code?

jatingoel
Автор

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

merabet.faycal
Автор

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.

jackgunderson
Автор

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.

EGL-P
Автор

how would it be the inverse, receive data from javascript to unity?

dariogarcia
Автор

Hey! How to sync float range slider from js to to Unity? Thanks

nicolasportu
Автор

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?

LouieLu-pzbj
Автор

how to save file into player local machine ? in webgl

rathodketan
Автор

is it possible with c# winform program without java/php?

돌림정
Автор

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.

RobertGercia
Автор

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?

RiderForge