'Getting an error to override onConnectedToMaster() in Unity

I have extended "MonoBehaviourPunCallbacks" to my class but still getting the override error. Unity version: 2021.3 and Photon Pun 2.

Error message

Assets\connectToServer.cs(15,26): error CS0115: 'connectToServer.onConnectedToMaster()': no suitable method found to override

Image of Class



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source