Network signal not working

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rubin
extends Node

var network = NetworkedMultiplayerENet.new()

func _ready():
	network.connect("connection_failed", self, "_on_connection_failed")
	network.connect("connection_succeeded", self, "_on_connection_succeeded")

func connect_to_server(ip : String, port : int): # Called from another script
	network.create_client(ip, port)
	get_tree().set_network_peer(network)

func _on_connection_failed(): # This function NEVER gets called
	print(":(")

func _on_connection_succeeded():
	print(":)")

When I try to connect to an offline server (which fails), the function _on_connection_failed() doen’t get called.

Nevermind… I solved it!

This signal is infact working properly, but it delays some time until the connection fails.

Rubin | 2021-12-11 16:28

Is this your own system? when not, could you post the tutorial? it sounds great, and i always have problems with multiplayer…

theMX89 | 2021-12-12 07:20

I’m following some tutorials but applying to the reality of my game (it’s a multiplayer FPS).

I think that “Game Development Center” Youtube channel videos about multiplayer are great, also Godot documentation help A LOOOOOOT :slight_smile:

Rubin | 2021-12-12 13:46