Be a Supporter!

Unity3d WebGL Support

  • 12,477 Views
  • 53 Replies
New Topic Respond to this Topic
PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Unity3d WebGL Support 2016-03-09 10:21:26 Reply

At 3/9/16 09:11 AM, Railman85 wrote:
It should also make un-compressed files. Try using those instead. When you put them in a zip, they get compressed for upload, and our servers should be serving them automatically compressed (without needing a .htaccess file).
thank you for your help.

For those who have this problem:
You can simply unzip your:
dogar.datagz
dogar.jsgz
dogar.memgz

into

dogar.data
dogar.js
dogar.mem

and it will work like a charm :)

Awesome, glad you got it working!


Arch-Angel likes this sig!

BBS Signature
azureda
azureda
  • Member since: Apr. 7, 2013
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Unity3d WebGL Support 2016-04-06 09:44:20 Reply

Just tested a mouse-based game with Unity 5.3 in WebGL and everything looks to be working pretty good.

S-Wallace
S-Wallace
  • Member since: May. 15, 2016
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Unity3d WebGL Support 2016-05-23 21:10:08 Reply

Having some trouble with resolution of window / assets. When i upload the file, all of my sprites are blurry and at a lower resolution than they should be. This does not happen in the editor, and neither does it happen when i make a normal .exe file and run it on my computer. I have changed the window resolution to 480x640 in the editor, and also in the player settings, but the issue is still present. Any ideas?

LunaWolfStudios
LunaWolfStudios
  • Member since: May. 27, 2015
  • Offline.
Forum Stats
Member
Level 02
Game Developer
Response to Unity3d WebGL Support 2016-05-28 00:01:09 Reply

I'm attempting to get https://github.com/AdamRVierra/NewgroundsAPIUnity Newgrounds API working in my Unity 3d Web GL project. I haven't published my game yet, but I was testing it in the preview and I can't tell if my high scores/medals are working. Would they become unlocked in preview mode? Or do I need to publish the game before they start working?

LunaWolfStudios
LunaWolfStudios
  • Member since: May. 27, 2015
  • Offline.
Forum Stats
Member
Level 02
Game Developer
Response to Unity3d WebGL Support 2016-05-28 23:19:56 (edited 2016-05-28 23:20:25) Reply

I've managed to get a step further, but now I'm receiving this error (Attached image) when I send something SubmitScore/UnlockMedal it seems WebGL and the Newgrounds API for Unity are just not playing nicely. Here's the most related thing I could find: http://forum.unity3d.com/threads/webgl-error.317662/

At 5/28/16 12:01 AM, LunaWolfStudios wrote: I'm attempting to get https://github.com/AdamRVierra/NewgroundsAPIUnity Newgrounds API working in my Unity 3d Web GL project. I haven't published my game yet, but I was testing it in the preview and I can't tell if my high scores/medals are working. Would they become unlocked in preview mode? Or do I need to publish the game before they start working?

Unity3d WebGL Support

PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Unity3d WebGL Support 2016-05-29 14:03:05 Reply

At 5/28/16 11:19 PM, LunaWolfStudios wrote: I've managed to get a step further, but now I'm receiving this error (Attached image) when I send something SubmitScore/UnlockMedal it seems WebGL and the Newgrounds API for Unity are just not playing nicely. Here's the most related thing I could find: http://forum.unity3d.com/threads/webgl-error.317662/

At 5/28/16 12:01 AM, LunaWolfStudios wrote: I'm attempting to get https://github.com/AdamRVierra/NewgroundsAPIUnity Newgrounds API working in my Unity 3d Web GL project. I haven't published my game yet, but I was testing it in the preview and I can't tell if my high scores/medals are working. Would they become unlocked in preview mode? Or do I need to publish the game before they start working?

If you're interested, there's an OFFICIAL Newgrounds beta client for Unity. It's not the best implementation (I have no idea how people package things for Unity yet), but it should get the job done.

If you're interested check out http://www.newgrounds.io


Arch-Angel likes this sig!

BBS Signature
HeroPower
HeroPower
  • Member since: Dec. 13, 2005
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to Unity3d WebGL Support 2016-05-29 14:55:38 Reply

At 5/29/16 02:03 PM, PsychoGoldfish wrote: If you're interested, there's an OFFICIAL Newgrounds beta client for Unity. It's not the best implementation (I have no idea how people package things for Unity yet), but it should get the job done.

If you're interested check out http://www.newgrounds.io

How long ago did this start? I've been waiting for Newgrounds to allow your API in Unity projects. This is super cool.

Do you guys think you will ever allow some form of Newground ads for Unity? My apologies if it is already in this beta API I haven't opened it yet.

PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Unity3d WebGL Support 2016-05-31 14:00:46 (edited 2016-05-31 14:01:50) Reply

At 5/29/16 02:55 PM, HeroPower wrote:
At 5/29/16 02:03 PM, PsychoGoldfish wrote: If you're interested, there's an OFFICIAL Newgrounds beta client for Unity. It's not the best implementation (I have no idea how people package things for Unity yet), but it should get the job done.

If you're interested check out http://www.newgrounds.io
How long ago did this start? I've been waiting for Newgrounds to allow your API in Unity projects. This is super cool.

I started on the new version late last year, and have had a really rough Unity library for quite some time now, but haven't had anyone test it out yet.

Do you guys think you will ever allow some form of Newground ads for Unity? My apologies if it is already in this beta API I haven't opened it yet.

We're actually not going to be including ads in this API at all. The older Flash API didn't work for several users because ad-blockers would block the entire API domain.

We've been looking at other options, such as a possible standalone advertising API, or a new revenue sharing setup for our portals, but web-based advertising is becoming less and less viable in general and may not be worth the time we'd have to invest to support it all. It really depends on finding the right advertising partner.


Arch-Angel likes this sig!

BBS Signature
LunaWolfStudios
LunaWolfStudios
  • Member since: May. 27, 2015
  • Offline.
Forum Stats
Member
Level 02
Game Developer
Response to Unity3d WebGL Support 2016-05-31 19:13:46 Reply

Wow this is awesome! I will take a look thank you! And this support Unity WebGL on NG?

At 5/29/16 02:03 PM, PsychoGoldfish wrote: If you're interested check out http://www.newgrounds.io
LunaWolfStudios
LunaWolfStudios
  • Member since: May. 27, 2015
  • Offline.
Forum Stats
Member
Level 02
Game Developer
Response to Unity3d WebGL Support 2016-05-31 20:07:52 Reply

At 5/29/16 02:03 PM, PsychoGoldfish wrote: If you're interested check out http://www.newgrounds.io

So I've begun implementing this and its pretty straight forward! Only thing is you may want to make the core not destroy on load. Also, using a tag to find the core would be easier and more dependable then having players drag the core object into the core variable.

I am a little confused as to the 'medal ids' and 'score ids' in the NG portal they are strings, but you are asking for integers. I assume if I have 3 medals they are id's 1, 2 and 3? Or are they 0, 1, and 2?

Thanks so much with this! It's really nice work.

PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Unity3d WebGL Support 2016-06-01 13:06:49 Reply

At 5/31/16 08:07 PM, LunaWolfStudios wrote:
At 5/29/16 02:03 PM, PsychoGoldfish wrote: If you're interested check out http://www.newgrounds.io
So I've begun implementing this and its pretty straight forward! Only thing is you may want to make the core not destroy on load. Also, using a tag to find the core would be easier and more dependable then having players drag the core object into the core variable.

Yeah, I'm not really a unity guy (this was the ONLY thing I have ever used it for). I have no idea how to best implement this. I wanted the core to be a standalone class you could just set statically somewhere, but I couldn't figure out how to get access to the game loop (for checking user sessions automatically) without extending MonoBehavior, and couldn't find any standalone timers that worked in Unity.

If any of you guys want to take a look at it and let me know if there's a better way of packaging/implementing this, I would definitely appreciate the help.


I am a little confused as to the 'medal ids' and 'score ids' in the NG portal they are strings, but you are asking for integers. I assume if I have 3 medals they are id's 1, 2 and 3? Or are they 0, 1, and 2?

Every medal on NG has a unique id. If you use the Medal.getList component, you'll get all that info in the return. In fact, I'm 99% sure I put an unlock() method on the medal objects that returns, so you could just use that too.


Thanks so much with this! It's really nice work.

Arch-Angel likes this sig!

BBS Signature
FireCake72
FireCake72
  • Member since: Apr. 9, 2016
  • Offline.
Forum Stats
Member
Level 03
Musician
Response to Unity3d WebGL Support 2016-06-08 10:45:04 Reply

At 5/12/15 12:04 PM, PsychoGoldfish wrote: Having problems with your Unity3D WebGL game? Please start here. If you've read through the wiki, searched Google, etc. and still haven't resolved your issue, feel free to ask a question here.

It seems that the WebGL build is glitching my particals in unity. It makes my first partical all streched out and the second partical does play the animation sheet correctly. In the stand alone build its just fine so it has something to do with the WebGL build. Are there any WebGL overrides I can do to stop this?

zephyo
zephyo
  • Member since: Nov. 29, 2013
  • Offline.
Forum Stats
Member
Level 01
Artist
Response to Unity3d WebGL Support 2016-06-09 11:16:24 Reply

Hi guys, have any of you found out exactly how to decompress the Released files from gz? I've heard of using 7zip but I'm using a Mac and renaming the extension doesn't work; gunzip in Terminal doesn't work.


BBS Signature
zephyo
zephyo
  • Member since: Nov. 29, 2013
  • Offline.
Forum Stats
Member
Level 01
Artist
Response to Unity3d WebGL Support 2016-06-09 11:21:40 (edited 2016-06-09 11:33:16) Reply

Oh wait.. You can get uncompressed Release files by doing a development build. But then there would be additional memory taking functions.


BBS Signature
StripedTiger
StripedTiger
  • Member since: Jul. 14, 2005
  • Offline.
Forum Stats
Member
Level 04
Game Developer
Response to Unity3d WebGL Support 2016-08-17 02:58:15 Reply

At 3/9/16 10:21 AM, PsychoGoldfish wrote:
At 3/9/16 09:11 AM, Railman85 wrote:
It should also make un-compressed files. Try using those instead. When you put them in a zip, they get compressed for upload, and our servers should be serving them automatically compressed (without needing a .htaccess file).
thank you for your help.

For those who have this problem:
You can simply unzip your:
dogar.datagz
dogar.jsgz
dogar.memgz

into

dogar.data
dogar.js
dogar.mem

and it will work like a charm :)
Awesome, glad you got it working!

I'm testing out a build, and I'm getting this error:
An error occured running the Unity content on this page. See your browser's JavaScript console for more info. The error was:
NotFoundError: The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened.

Also. I'm confused how you're changing the release files.

StripedTiger
StripedTiger
  • Member since: Jul. 14, 2005
  • Offline.
Forum Stats
Member
Level 04
Game Developer
Response to Unity3d WebGL Support 2016-08-18 02:46:57 Reply

So I figured out how to uncompress the release files, I didn't realize they were like zip files. I feel dumb.

Anyways, I still get the same error on firefox, but now it works perfectly in chrome.

I feel I've reached an impasse...

PewPewNutStudios
PewPewNutStudios
  • Member since: Aug. 3, 2016
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Unity3d WebGL Support 2016-08-26 21:24:44 Reply

I've been trying to upload a WebGL game for a few days now with no luck.

I keep getting these error messages:

You need a browser which supports WebGL to run this content. Try installing Firefox.

(The game worked previously but now it doesn't)

If I add the Unity3D plugin I get this:

Unity3d WebGL Support

logichan
logichan
  • Member since: Mar. 10, 2015
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to Unity3d WebGL Support 2016-09-22 03:26:33 Reply

Wow, newgrounds.io is crazy cool! I wish I would have known about it before deciding my most recent game was finished, haha!

HelpThePoor
HelpThePoor
  • Member since: Oct. 22, 2013
  • Offline.
Forum Stats
Member
Level 03
Game Developer
Response to Unity3d WebGL Support 2016-09-24 11:00:37 Reply

I have a problem. I downloaded the repository for Unity's WebGL at https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c/downloads?tab=downloads to my Mac. It downloaded as a folder instead of as a compressed file, so I used my Mac's Finder to move the three folders inside the "Assets" folder named "io," "Plugins," and "SimpleJSON," into my Unity project. However, when I open the project, the folders and their contents are no where to be found in the project. I also tried to Import New Asset and Import Custom Package, but Unity does not recognize the downloaded folders as importable. Could this be because the repository is designed for Windows and not for Mac? Any suggestions? Thanks.

CoalFlameIce
CoalFlameIce
  • Member since: Dec. 19, 2013
  • Offline.
Forum Stats
Member
Level 06
Gamer
Response to Unity3d WebGL Support 2017-02-23 18:33:30 Reply

Hello there. I have been trying to upload my Unity game to newgrounds, but since chrome no longer supports webplayer, I've been using webGL. However, when I go to preview my game, I always get a memory error. If I set my memory in player settings below 1000, i get a message saying that chrome ran out of memory. When I set it above 1000, I get a weird error saying something about an "invalid array error". How do I fix this? What should I set the memory value to?

NextGenGame
NextGenGame
  • Member since: Feb. 9, 2017
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Unity3d WebGL Support 2017-02-24 12:55:15 (edited 2017-02-24 12:56:12) Reply

At 3/9/16 10:21 AM, PsychoGoldfish wrote:
At 3/9/16 09:11 AM, Railman85 wrote:
It should also make un-compressed files. Try using those instead. When you put them in a zip, they get compressed for upload, and our servers should be serving them automatically compressed (without needing a .htaccess file).
thank you for your help.

For those who have this problem:
You can simply unzip your:
dogar.datagz
dogar.jsgz
dogar.memgz

into

dogar.data
dogar.js
dogar.mem

and it will work like a charm :)
Awesome, glad you got it working!

yes i did this too and it work but the loading time is x10 slower than befor did you find any idea to reduce the size of loading ?

DigitalCartridge
DigitalCartridge
  • Member since: Mar. 31, 2017
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Unity3d WebGL Support 2017-04-02 04:11:58 Reply

My game runs perfectly fine on 1024*576 but for some reason my UI seems to scale up when running on 640*360. When I run it on my editor with a 640*360 resolution it shows everything properly. I am using unity UI . Any idea why this might be happening ?

AirBiscuit
AirBiscuit
  • Member since: Sep. 11, 2015
  • Offline.
Forum Stats
Member
Level 03
Programmer
Response to Unity3d WebGL Support 2017-04-23 09:21:23 Reply

Are they ever going to fix Keyboard input either not being read or sticking after release? And WebGL seems to love randomly omitting a script or 2 just to cause a headache for me.

At this rate it seems best practice is make mouse controlled games and pray nothing goes wrong in the build or you have a horrible time

StripedTiger
StripedTiger
  • Member since: Jul. 14, 2005
  • Offline.
Forum Stats
Member
Level 04
Game Developer
Response to Unity3d WebGL Support 2017-04-29 19:45:48 (edited 2017-04-29 19:46:34) Reply

So I finally found a solution to the NotFoundError
An error occured running the Unity content on this page. See your browser's JavaScript console for more info. The error was:
NotFoundError: The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened.

So after doing some more digging on google, it turns out the error resided in my local storage folders.

So I went to (user)\AppData\Roaming\Mozilla\Firefox\Profiles\(profile)\storage\default

and I moved http+++uploads.ungrounded.net to my desktop, and it automatically recreates itself, and voila! I'm not getting that error anymore.

That's an ENORMOUS hurdle out of my way, I'm actually now motivated to continue developing 3D games for ng, now that I have this albatross off my neck!