Godot Version
Godot 4.4.1
Question
I’m trying to disconnect the players when they click the “quit” button. This is the code I have for the button:
func OnQuitPressed():
if multiplayer.is_server():
multiplayer.multiplayer_peer.close()
else:
multiplayer.multiplayer_peer.disconnect_peer(multiplayer.get_unique_id())
LevelManager.ReturnToMainMenu()
However, I get the following error when the button is clicked:
Condition "!_is_active() || !peers.has(p_peer)" is true.
I tried looking around a little, but I couldn’t find anything about this error. This feels obvious, but I am quite new to the engine (this multiplayer shooter is my first project). If you need more information, just let me know. Thank you!