- Home /
Save Unity Web Player Game
Is it possible to save a Unity web player game? I was looking at this question: How Do I Save Unity Web Player Game. But I couldn't seem to understand if it worked with what I was asking. If it is possible, how would I use the method in that link to save a Unity web player game?
Are you looking to save the game state or save the game to disk so you can play it offline? The question you linked is about the latter. If you want to play your own game offline you can either just download the data and html files and run them in a browser offline, but personally I'd just make a PC build for playing offline.
I want to save the game to my disk to play it offline. Side question: Is it legal to download another person's free web player game to play it offline?
Answer by pstreef · Jun 17, 2014 at 09:52 PM
If you want to download a Unity web player game to disk do the following:
First save the html file that displays the game (right click save as). Open the html file in notepad (or similar) and look for the (if it has not been renamed) this should have an element like this:
<embed src="build.unity3d" type="application/vnd.unity" width="960" height="600" firstframecallback="UnityObject2.instances[0].firstFrameCallback();" enabledebugging="0" style="display: block; width: 960px; height: 600px;">
if the site does not prohibit this, you can download the build.unity3d (or whatever it is named, you can find it in the code) by going to www.example.com/build.unity3d (where www.example.com is the url where the game is stored and "build.unity3d" is whatever is in the src of the embed element).
Put both files in the same folder (or similar folder structure as it was on the page, alternatively you can edit the embed element to point to the data file) and open the .html in a browser. If you have the unity webplayer installen it should run.
You can test this by downloading one of my games from: games.peterstreef.nl to play them offline.
The question if it is legal is a hard one, it depends on the wishes of the person hosting it. But personally If i would host a game on a site I wouldn't mind someone playing it offline.
So I saved the build.unity3d file and the html file. When I launched the html file all it said was install Unity Web Player which is installed because it worked fine on the online website. So I tried it with the website I was wanting to do it for, and nothing showed up. Then I went into the html file and it said the content was missing. So I replaced the tag with an embed tag that told it to find the build.unity3d file in my documents. So the game started up and showed the main menu, but I couldn't click anything and it wasnt working. Then I moved the build.unity3d into a file called build and it was still in the same file structure as the html file. So now when I start the html file, it shows a unity loading screen, but nothing loads. I'm sorry this is really long, but I felt that if I included more detail, it would be easier to find a solution.
Originally I had the html and the unity3d files in the same folder. It didnt work. So I moved the unity3d file to its only folder. It got closer to working. Then I put the unity3d file back into the folder with the html file. It worked. So yeah, thanks for the help!
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Animation not working properly in unity web player 0 Answers
Download Specific Version of Unity 3D 1 Answer
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
How much data can I send from the browser through unityObject.SendMessage()? 1 Answer