How to leave a game?
Options
njt1982
✭
in Photon Bolt
This sounds like it should be trivial...
I have a 2 player server/client game. I've made a small behaviour so if Escape is pressed it should disconnect from the game.
I've tried searching but cant see any obvious suggestions. Any thoughts?
I have a 2 player server/client game. I've made a small behaviour so if Escape is pressed it should disconnect from the game.
using UnityEngine; public class GameQuitHandler : MonoBehaviour { void OnGUI() { Event e = Event.current; if(e.isKey) { Debug.Log("Detected Key Code: " + e.keyCode); if(e.keyCode == KeyCode.Escape) { Debug.Log("ESCAPE"); BoltNetwork.LoadScene("Main Menu"); } } } }It seems this is not enough, though. I end up back on the Main Menu scene, but I seem to have all the instantiated objects from my game.
I've tried searching but cant see any obvious suggestions. Any thoughts?
0
Comments
-
Hmm my mistake, I didn't realise there was a difference between a discussion and a question post type!0
-
BoltNetwork.Shutdown()1
-
Hmm I dont seem to have that method on the class. Is it an instance method?0 -
Ahhh wait...
BoltLauncher.Shutdown()
?0 -
Yes sorry1
-
That Shutdown thing definitely made a huge difference. I can now quit to the main menu and none of the game stuff spawns up + I can restart/join other games without Bolt complaining that its already running.0