diff --git a/copyMultiplayer.gd b/copyMultiplayer.gd index 8f97286..a20c7a5 100644 --- a/copyMultiplayer.gd +++ b/copyMultiplayer.gd @@ -273,13 +273,11 @@ func get_sync_controller(peer_id: int): #-> SyncController: return get_node_or_null(str(peer_id)) #as SyncController func get_all_sync_controllers(): #-> Array[SyncController]: - return get_children() - # NOTE: Let's just assume all child nodes are SyncController. - # var result: Array[SyncController] = [] - # for controller in get_children(): - # if controller is SyncController: - # result.append(controller) - # return result + var result = [] + for controller in get_children(): + if controller.get_script() == SyncController: + result.append(controller) + return result func get_player_stats(peer_id: int): #-> PlayerStats: if peer_id == multiplayer.get_unique_id(): return main_stats