diff --git a/sdks/unity/AgonesSdk.cs b/sdks/unity/AgonesSdk.cs index fe1c422674..8f0df9b36c 100644 --- a/sdks/unity/AgonesSdk.cs +++ b/sdks/unity/AgonesSdk.cs @@ -44,7 +44,7 @@ public class AgonesSdk : MonoBehaviour /// public bool logEnabled = false; - private const string sidecarAddress = "http://localhost:59358"; + private string sidecarAddress; private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); private struct KeyValueMessage @@ -58,6 +58,8 @@ private struct KeyValueMessage // Use this for initialization. private void Start() { + String port = Environment.GetEnvironmentVariable("AGONES_SDK_HTTP_PORT"); + sidecarAddress = "http://localhost:" + (port ?? "59358"); HealthCheckAsync(); }