Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Sprowk |
I’m trying to create a game where one player starts a server and others enter his IP address and connect to him. I managed to get it working for localhost and also for 2 computers at the same Wifi.
The problem is when I try to do it with my friend (who is connected to a different network) he can’t connect to my server. This is part of my autoload script:
func host_game(new_player_name):
player_name = new_player_name
var host = NetworkedMultiplayerENet.new()
host.create_server(DEFAULT_PORT, MAX_PEERS)
get_tree().set_network_peer(host)
func join_game(ip, new_player_name):
player_name = new_player_name
var client = NetworkedMultiplayerENet.new()
client.create_client(ip, DEFAULT_PORT)
get_tree().set_network_peer(client)
Is something wrong with the code, router or am I just entering the wrong IP? I tried to enter IP from websites like whatsmyip and also ipv4 from command ipconfig.
Edit: I found a good answer here: Private vs Public IP Addresses - Archive - Godot Forum but couldn’t set up my router so I looked further. Found free hosting site for Godot games ( https://gotm.io/ ). Easy to upload but still can’t figure out how to enable multiplayer. Any ideas?
Found free hosting site for Godot games ( https://gotm.io/ ). Easy to upload but still can’t figure out how to enable multiplayer. Any ideas?
That website won’t provide hosted multiplayer servers (or a way to avoid port forwarding if you’re hosting a server on your own PC).
Calinou | 2020-03-31 07:23
Okay so I tried to do it with port forwarding (port 10567). Disabled all firewalls on windows 10. Also setup static IP on my computer and set the wifi as private. Still my friend (client) couldn’t connect to me (server). Any ideas? I’ll probably ask this as a new question though.
Sprowk | 2020-03-31 19:39