[MUSIC] In this lecture, I will explore building our game for the Unity Web Player. Our objectives will be to setup the default player settings that transcend all of our builds. Explore the specific web player player settings. Build the web player. And customize the HTML file that you need builds. Okay, to build for the web player, we're gonna start by going to file and build settings. And we of course, we want to make sure that all the scenes that we wanna have built are in our scenes to build. We did that on a previous step. But if you've you know, created new levels and that sort of thing, make sure that these are included in your Scenes to Build at the top here. The next thing that we wanna do is choose the platform that we wanna build to. So in this lecture we're gonna be talking about building for the Web Player, which I've already got targeted. If you don't go ahead and click on the Web Player, then click Switch Platform. Make sure the little Unity icon is here. That's the platform that's currently targeted. Now,if all of our build settings are proper we can just go ahead and build right away. But I'm gonna go ahead and adjust some of my player settings here. So click the player settings button and that will bring up the player settings over the inspector. I'm gonna go ahead and set up some of these defaults that will cut a cross all of the platforms that they were ultimately built for. So, the first thing is company name. I wanna change this from the default to my company name. Go ahead and set it to whatever you want. I'm gonna go ahead and set mine to Michigan State University, and the product name, of course, is the name of the game. And this defaults to whatever you named the project when you first started, so now mine says Super Sparty Brothers. Of course, you could go ahead and customize this to whatever you want. I'll just leave mine as Super Sparty Brothers. The next thing is to see where we can set a default icon. So typically we would wanna create a 1024x1024 pixel image and set that as our default icon. I've actually included one for you which, of course, you could customize and make your own. But in the art folder there is an icon and slash sub-folder. And within this, we've got actually two icons. One with no background, basically a transparent background, and one with a solid black background. So for the default icon, I want to use the no background version. So I'll go ahead and drag and drop this on the texture box here. Now, we can also set a default cursor, so this is the mouse cursor. You know right now I'm just using the default mouse cursor, which is the arrow of course. You can actually create a custom cursor. Since my game is fully controller controlled, I'm controlling an avatar, and the mouse pointer is really just used for selecting things in menus, I'm just gonna go ahead and go with the regular operating system mouse pointer. And not set a default pointer. But just realize that's an option that you can actually set. Now down below, these are all the possible platforms that we can target, so right now the current on selected is the web player and ultimately we'll walk through a few of these others in upcoming lectures. But let's go ahead and set up the web player settings. So under resolution and presentation, this is where you can set the width and height of your game. So by default, mine is set at 960 by 600, which is a 4 by 3 aspect ratio, which is really what I've been testing here in the editor. Now if I wanted something that was a 16 by 9 ratio, I would have to go ahead and modify these numbers to be the respective size and aspect ratio that I so chose. Down below is the web player template. They just give you three kind of basic templates to start with. For this example I'm gonna go ahead and choose the black background template, cause I think it works a little bit better with the look of my game. And let's go ahead and look at some of the other settings for the web player. If you go under icon, notice it's not applicable fro this platform. So this default icon that we set at the top really has no effect on the web player platform, but it will effect some of the other platforms that we'll look at in the future. The same goes for Splash Image. There really is no splash image for the Web Player. And then under Other Settings, we've got a variety of Rendering, Streaming, Configuration, and Optimization settings. Generally you can go for the defaults with these. You know it's important to have these at your fingertips if you needed to modify these things. And of course remember you can always look at the documentation. The little book icon here you can click at the top It'll bring up the documentation and there's links, of course, to all the different platforms. You know, I highly recommend reading through the documentation particularly before you build for your target audience. Or before you build to deploy to end users. So now that I have my web player settings set to my likings, I'm going to go ahead and choose build. And generally I always like to build to a builds folder so here in my Super Sparty Brothers project folder you can see there's the assets folder where all my project assets are located. There's the library folder, project settings and temp. These folders are all controlled by Unity so I don't wanna put this inside any of these folders. I wanna put it at the top level of my project. So I'm gonna go ahead and create a new folder called Builds. So within the Builds Folder, I'm gonna put all of my respective platform builds. So right now, I'm building for the web player, I wanna pick a name that makes sense for the web player. So I'm gonna go ahead and name this something like Super Sparty Brothers Web Player, and I'll use camel casing to separate the words there. And I'll go ahead and click Save. And this will go through the process of building for this platform. Depending on the size and complexity of your project, this may take a while. It won't take too long for my project currently. So you can see here, it opened the Builds folder, and within that it created the Super Sparty Brothers Web Player folder. And within that it created two files. It created an HTML file and a Unity 3D file. So the HTML file is what your browser will open and render, and that's the template that we picked. And the HTML will actually link to the Unity 3D file. So I typically like to rename the HTML file to something like index.html, that way when I put this on a webserver I can just type the URL. So I can say something like Superspartybrotherswebplayer slash, and the webserver will automatically serve up whatever the default HTML is. It's typically index.html So the HTML itself links to the .unity3d file. So once I actually build, I don't wanna rename this file because if I do, it'll break the link from the HTML file. So if I did rename this, I'd actually have to go into the HTML code and then modify all the link references to the .unity3d file. Now this is essentially ready to upload to a web server but I often like to customize the template look and you can use any web authoring tools such as Adobe Dreamweaver or even a text editor if you know HTML. I'm gonna actually open this in Blue Griffin, which is a nice free tool available for Windows, Mac, and Linux. So here you can see the template. There's some default text at the top. It shows the name of our game based on, you know, the name that we put in the player settings. And of course we can customize this. I might actually just get rid of the top line. So I'm just gonna select that and delete it. The middle area will actually be replaced with our game for those that actually have the Unity Web Player. If not, it will display a message on how to download, install the Unity Web Player. Then scrolling down at the very bottom, we have a footer. This is a great place to put something like a copyright message. So I can type something like copyright 2016 Michigan State University. And of course you can type whatever respective copyright or whatever message you want down below there. Or you can just eliminate the text at the bottom of the template. So I'm gonna go ahead and save this. And go back to my file system and go ahead and open my HTML file. If I right-click on this, I can choose Open With. And this will show all the potential browsers. Remember the newer versions of Google Chrome currently do not support the Unity Web Player. So I'd have to pick something like Firefox or Safari or Internet Explorer or Opera. I'm gonna go ahead and pick Safari. And Safari opens and plays my loading message and then brings us to the main menu, and of course from here I can start playing the game. As you may be aware, some of the browser manufacturers, such as Google, are dropping support for external plug ins in their browser moving forward. This means that no plug-ins will work, including the Unity web player plug-in. While there still are some browsers that support the web Unity player, it is a major roadblock to require a player to go and use a specific browser to access your game. Therefore, Unity has deprecated the web player. What this means is that they'll no longer support it and it will eventually be removed from Unit as a build option. In short the days of the Unity Web Player are numbered. So what is the future of playing Unity games on the web? We'll explore this in the next lecture. [MUSIC]