Godot Version
4.1
Question
I am following a tutorial on LAN Hosting. I have a server browser as well. When I run 2 sessions of Godot on my computer and run Godot on my phone, I can join the host from the other session on the computer. Although I can see the server on my phone, it won’t join the server. I can see this because the number of players goes up when I click join from the other session on the computer, but it doesn’t when I click join from the phone. Does anyone know why that would be the case?
1 Like
func join_game(address : String):
if address.is_empty():
address = DEFAULT_SERVER_IP
var peer = ENetMultiplayerPeer.new()
var error = peer.create_client(address, PORT)
peer.get_host().compress(ENetConnection.COMPRESS_RANGE_CODER)
multiplayer.set_multiplayer_peer(peer)
player_info.name = name_input.text
player_info.id = multiplayer.get_unique_id()
func create_game():
var peer = ENetMultiplayerPeer.new()
var error = peer.create_server(PORT, MAX_CONNECTIONS)
if error != OK:
print("cannot host: " + str(error))
return
peer.get_host().compress(ENetConnection.COMPRESS_RANGE_CODER)
multiplayer.set_multiplayer_peer(peer)
player_info.name = name_input.text
player_info.id = multiplayer.get_unique_id()
this is the code I used for hosting and joining a game. Does someone see a problem here?