# How to turn the hotspot on automatically in Unity?

I have made a simple LAN multi-player game in Unity (just for learning purposes).

This is the main code (for connection):

using UnityEngine;
using System.Collections;

public class StartServer : MonoBehaviour
{
public Transform Makan;
public Transform CubeOBJ;
public string SSS;

void OnGUI ()
{

if (Network.peerType == NetworkPeerType.Disconnected)
{
SSS = GUILayout.TextField (SSS);

if (GUILayout.Button ("StartServer"))
{
Network.InitializeServer(10, 25000);
}

if (GUILayout.Button ("Connect"))
{
Network.Connect (SSS, 25000);
}
}
else
{
if (GUILayout.Button ("creatCube"))
{
Network.Instantiate (CubeOBJ, Makan.transform.position, Makan.transform.rotation, 0);
}
}
}
}


It works good. The problem is that in mobile devices I should turn on hotspot by myself for one of the devices.

How can I do this automatically from code?

• Why do you want to activate it automatically? Just alert the user that it is not active. Jul 30 '16 at 17:36
• u mean there is no way to active it automatically?
– dave
Jul 30 '16 at 17:40
• No, I don't mean that. I said that what you want to do is not necessary. Jul 30 '16 at 17:43
• maybe some users don't know how to turn on hotspot xD. anyway i want to know how to do it. and why there is nothing about it in unity documentation?
– dave
Jul 30 '16 at 17:49
• Because it has nothing to do with Unity itself, it is about the device you run your game on. Jul 30 '16 at 18:18