publishing webgl to wordpress

I have a unity webGL project (unity2017) I am hoping to embed on a wordpress site, and google has provided me with surprisingly sparse and unhelpful resources.  Can anyone explain it to me or point me in the direction of a good tutorial?  I know a little bit of html and javascript if that ends up being relevant.  Hoping to do everything from the front end, but wordpress only allows for files to be uploaded, not directories. Any help is appreciated.

  • Alexey Korovenkov(alexey88) replied

    Plugins allow the inclusion of a Unity3d WebGL application.

    Perhaps it will be useful: https://wordpress.org/plugins/search/Unity/

  • John Sanderson(procyonlotor) replied

    I have looked at these, but it does not appear there is one for WebGL that is up to date with the current version of Unity. The files and directories that a WebGL build currently produces are different than what the HoweScape plugin (most up to date available) expects.

  • Alexey Korovenkov(alexey88) replied

    As I can see on this video:

    During the compilation of the WebGL project, creates "Index.html". If you rename this file to "GameName.php", and in the first line in the file you add <?php and then put this code: include '/FolderName/GameName.php'; inside the place of Wordpress Theme, where should the game be located. 

    It might take a little customization, for a good look, but... Everything should work, in theory. 


  • Jonathan Gonzalez(jgonzalez) replied

    It was covered in this lesson: Publishing Web GL with Wordpress.  We previously used it to embed our Tower Defense game into a Wordpress article, although we no longer use Wordpress. Unfortunately this process isn't as easy as I would hope it would be. It mostly comes down to getting a proper place to upload it to that will allow you to make it public. 

    I've uploaded to Dropbox before when they had the global public folder you could use, now that's only for business accounts. Amazon S3 has been real hit or miss with getting Web GL to work for us, half the time it won't allow us to make it public or it keeps reverting back. You could also use the Unity Cloud Build to build your Web GL game then use that. It'll host the build of the game and you should be able to get a public link from it. 

    We are currently working on a Web GL uploader for the site so that members can upload Web GL Unity exercises and we'd also like to have an arcade section on the site for Unity based games.

  • John Sanderson(procyonlotor) replied

    thanks for the help, Alexey and Jonathan.  I had watched the cgc video long before, and remembered seeing it somewhere, but had completely forgotten where, haha! Funny that the title of the video was virtually the same as the title of this post.  This was a little volunteer project I did for the company I work for.  They have a Microsoft One Drive account so I am hoping that can be used the same way as dropbox or amazon s3, but I will have to get with my boss so he can make the files public.  I'll keep you posted on my progress.

  • Jonathan Gonzalez(jgonzalez) replied

    Great. Yeah the biggest issue is just getting a public link. The embedding itself isn't really difficult, although I do wish Unity made it easier. It seems like this process should be streamlined from their end to allow developers to easily embed in popular website platforms. 

  • John Sanderson(procyonlotor) replied

    I was surprised given that they market so much to smaller teams that there wasn't a drag and drop method already.

  • resin213 replied

    Great to hear! I was hoping something like this was on the roadmap.

  • soft8soft replied

    Since version 2.7 Verge3D for Blender comes with ready-to-use WordPress plug-in. See how to install and use it here.