I’ve been struggling to wrap my brain around how the p2p system works and would appreciate any help.
I want it so when the text next to the join button has the id of the other players game they can press join and connect to them. But it currently does nothing.
you cannot just disable IP sharing, there’s no way to connect then
i had to find that out the hard way
but why is the action there if it basically disables connection
or is that its purpose?
It’s purpose is to not allow IP sharing. If you do not have the IP of the other, you cannot send them data directly, you have to set-up an intermediary relay server who’s IP both computers can use which just relays data from the one to the other. Such a server is called a TURN server, and you can instruct your game to use some with the “Add ICE candidate” action. Even if you do not plan to switch IP sharing off, it is a good idea to still set-up a TURN server, so if the devices or router or ISP or firewall or something in your player’s setup blocks P2P direct connections, P2P can fallback to using the relay server.