I am trying build a game server for Linux using Could Build, but to achieve that I need “headless mode” option to be enabled. It’s mandatory to run the build on my Debian machine.
But there’s no such option in “Advanced options” section at project’s page in Unity Could Build. There’s a “Pre-Export Method Name” option, though, but I don’t know how to enabled headless mode using it:
public class CloudBuild
{
public static void BeforeBuild()
{
??? BuildOptions.EnableHeadlessMode
}
}
using UnityEngine;
using UnityEditor;
public class CloudBuild: MonoBehaviour
{
public static void BeforeBuild()
{
EditorUserBuildSettings.enableHeadlessMode = true;
}
}
What am I doing wrong? I’ve put this script into “Assets/Editor” folder, and set “CloudBuild.BeforeBuild” as a “Pre-Build Script”, but the resulting build is 100% identical with the one without such option. Also, I can attach the full build log.
UPD. So, apparently, with this option enabled I cannot get the build with headless mode. I’ve added a Debug.Log line to check if it gets executed, and it does.
I believe I should pass the BuildOptions.EnableHeadlessMode option somewhere somehow. How can I access the building pipeline then?
The BuildOptions.EnableHeadlessMode enum is passed into the final call to the BuildPipeline.BuildPlayer function if you are doing a build directly. We ultimately run that in Unity cloud build, let me check on our usage of the BuildOptions and EditorUserBuildSettings.enableHeadlessMode and get back to you.
Sorry about the delay in getting back to you. We only support a subset of the BuildOptions enum in cloud build and headless mode is not one of those options currently. I’ve been discussing options with the team about expanding those options and how best to handle it but nothing concrete just yet.
I’m also looking for a solution to the same problem. The server part of my game needs to run headless and I currently have no way of making these builds other than doing it manually.
I am also looking for this support. Unless there’s plans to get that unet server .dll out there fairly quickly I need to imagine headless linux builds are only going to become more common.
@Ryanc_unity What is the status of this now? We’re also exploring to incorporate Unity Cloud build in our company, but this is a must-have feature in order to pass.