PUN2 - Change Master Client on Disconnect

Hello everyone,
I am new in Game Development and completely new in Multiplayer Networking. I am creating a Racing game and somehow I succeed to implement online multiplayer on my game using PUN2 and I am using Unity 2019.4.6f1. Everything is working fine except one thing. When Master Client is leaving the game, everyone disconnecting instantly. I searched everywhere but didn't find any solution. How to switch Master Client on disconnect and continue my game normally?

Best Answer