Skip to content

Instantly share code, notes, and snippets.

View chrisl8's full-sized avatar
🤖
Trying to human

Christen Lofland chrisl8

🤖
Trying to human
View GitHub Profile
@chrisl8
chrisl8 / startup.gd
Created September 14, 2023 13:57 — forked from CrankyBunny/startup.gd
Determine the instance number for Godot run multiple instances feature
var _instance_num := -1
var _instance_socket: TCPServer
func _init() -> void:
if OS.is_debug_build():
_instance_socket = TCPServer.new()
for n in range(0,4):
if _instance_socket.listen(5000 + n) == OK:
_instance_num = n
break