
If all goes well, your folder should look like this: For other uses, check the Firebase CLI documentation. Remember to run the Firebase Client in the folder where your WebGL build is! You can test locally using firebase serve -only hosting, and, if everything is ok, send it to the cloud by using firebase deploy. Now, we will send the project from your computer to the cloud! Install the Firebase CLI, login ( firebase login), test ( firebase projects:list) and, if everything is ok, you can initialize your project with the hosting functionality: firebase init hosting. Also, this will also get basic analytics data if you allow the project to use it! Test and Deploy The first step is to create a Firebase project and register a Web app in your project (the first step only). We will get the hosting part done first, as it’s easier! Create the Firebase Project Firebase saved us! And now I hope this tutorial will help anybody else that may want to use it with a WebGL build like us! Enough chit-chat, let’s get to the point! Installing Firebase and Hosting the WebGL Build So, our machine was super slow and it became impossible to host the game there. We were previously hosting our own server in our university’s machine… But here in Brazil we don’t get much funding nowadays, specially when researching on games. So, to get as many people as possible to play the game, it’s very important for me to host it as a web game (people tend to get lazy when it comes to downloading simple games, specially if they have to answer some questionnaires later). I’m using this specific WebGL setup to conduct anonymous experiments with players for my PhD using Artificial Intelligence to generate procedural contents for my game prototype.

However, we will also learn how to collect this data to Firestore even for desktop or mobile builds (as it’s much easier and the project will be ready for it anyway). We will host our WebGL build and collect some gameplay data, saving in a Firestore database. This is about setting things up for every Unity build type and testing with a simple Hosting and Firestore usage.

And there are some awesome tutorials over the internet, like this one for Analytics events usage. But, Firebase’s Youtube has some nice videos about it. There are many cloud database products, the analytics side, the server… This isn’t a full guide to Firebase applications in Unity (at least not yet… Maybe in some months…). Salutations! If you are here, you’re probably interested in adding some Firebase functionalities to your Unity project, right? That was what I wanted!įirebase is HUGE and its free tier is enough for many indie and research projects.

Photo by Element5 Digital on Unsplash Introduction
