Hello everyone! I want to make my online game. How can I make it so that when I click the PLAY button, the game searches for a free server and connects to it. And if he does not find a free server, then he needs to create it and connect to it.
That would depend on the networking API you're using. For example, Photon Cloud has this functionality largely integrated, so you'd follow their documentation. If you take a more low level approach you're talking about a rather complex set of systems you'd create from the ground up. Far too big for a single forum thread. You'd need to break this into smaller problems you tackle one at a time.
Yes. Have a look at the basics tutorial to learn it: https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial