diff --git a/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs b/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs index 63c263f45..728d3dace 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs @@ -104,12 +104,12 @@ function disconnect() // else physics resources will not cleanup properly. physicsStopSimulation( "client" ); + disconnectedCleanup(); + // Delete the connection if it's still there. if (isObject(ServerConnection)) ServerConnection.delete(); - disconnectedCleanup(); - // Call destroyServer in case we're hosting destroyServer(); }