15 lines
314 B
GDScript3
Raw Normal View History

2024-01-20 21:18:58 +00:00
extends NetworkNode
@export var ip := "127.0.0.1"
@export var port := 4242
var socket := PacketPeerUDP.new()
func _init():
super._init()
socket.connect_to_host(ip, port)
func _process(_delta):
while socket.get_available_packet_count() > 0:
var packet := socket.get_packet()
handle_packet(packet, socket)