Search Unity

Can Unity Web Player be installed on websites?

Discussion in 'Editor & General Support' started by BrentMichie, Jan 29, 2015.

  1. BrentMichie

    BrentMichie

    Joined:
    Sep 10, 2014
    Posts:
    32
    What I mean is, can I place an installation of the web player on my website so each individual user who wants to play my game doesn't have to download the unity web player to play it.

    I suspect that having to download the web player to access the game will be enough hassle for many people to not bother trying the game out.

    Can someone offer me a solution to this or some form of workaround?

    Appreciate any responses.
     
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Your game players will need to use the features that cause the web player to be downloaded and installed for them. The download-and-install is only one of 3 methods, and is the one that the install process switches to if the automated ones don't work.

    In the future, making a build using WebGL will be the solution.
     
  3. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    324
    @Graham Dunnett , I know I'm not the OP, but I had been wondering a similar thing, since at the moment I place my games on my portfolio site. Is WebGL available in the free version, or only in the Pro version in Unity 5?
     
  4. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  5. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    324
    Thanks, Graham! We'll just have to wait and see, then :) Looking forward to Unity 5!
     
  6. BrentMichie

    BrentMichie

    Joined:
    Sep 10, 2014
    Posts:
    32
    Can you give me some more information on WebGL. What is it exactly and are there any tutorials on how to set that up?

    While I'm here can I ask what the best method is to save a data file from the web player. I want to setup a global leaderboard but don't know how.
     
  7. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Well, do some searching on WebGL. Then, building to WebGL from Unity basically creates a massive javascript version of your game, which a browser can playback without a plugin. The details are more related to asm.js, which is an extremely fast subset of Javascript.

    Use WWW and WWWPost to send the data to your server. Maybe the second example here:

    http://docs.unity3d.com/ScriptReference/WWWForm.html

    which shows how to do a high score table is close to what you want.
     
  8. BrentMichie

    BrentMichie

    Joined:
    Sep 10, 2014
    Posts:
    32
    The Save script is in JS and has a yield function on the download. Can someone please explain to me what the equivolent way to wait for the download to complete is in c# I've searched but can't find anything that does that simply.

    With the .pl scripts do I need two. One for highscores.pl and one to hold the script given in the above link? If so, what should I name the second one?

    I'm very new to this and the tutorials on these topics assume a lot of knowledge which I don't have.

    Appreciate any help you can give me.
     
  9. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    See: http://docs.unity3d.com/Manual/Coroutines.html to read up on coroutines in c#.

    One script will run inside your game and be written in c# or JS. The other script will be perl, or php, or whatever you choose and will run on your server.
     
  10. BrentMichie

    BrentMichie

    Joined:
    Sep 10, 2014
    Posts:
    32
    I know what coroutines are. I'm asking what the yield function in JS does. I assume it waits for the file to download then continues with the code. All I need is the syntax which does that.

    Surely someone before me has wanted to save some data from a unity game to their website and then reference it. Surely someone has already created a perl or php script which I could look at to do this? I am searching for this on the internet but all the examples are not what I'm looking for. I looked at some basic perl tutorials and they are teaching me how to do "Hello World" I don't need to know that syntax.

    So frustrating. What I'm also getting from Unity is that they don't have a way of doing this yet using commands inside unity? That seems like a major limitation. I mean, I chose Unity in the first place because its very easy to learn and does simple things really well but this seems to be a major road bump which does not have a simple solution.
     
  11. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Doesn't the WWW documentation help you?

    c#: yield return www;
    JS: yield www;

    That is what is shown on the WWW documentation page, at least. Does that not work for you? You want to convert a JS script into c#. On the documentation page you can see the c# and JS versions of the examples by using the buttons top right.

    And yes, someone has created a perl script, it is here:

    http://docs.unity3d.com/ScriptReference/WWWForm.html

    Does this perl script not work for you? Put it on your server and try it out.