godot-webrtc-mplayer-testing/scripts/screens/game.gd
2021-12-08 16:35:37 -06:00

18 lines
359 B
GDScript

extends Node2D
onready var player = preload("res://objects/player.tscn")
func _ready():
rpc("add_player", get_tree().get_network_unique_id())
func _process(delta):
pass
remotesync func add_player(peer_id):
var new_player = player.instance()
new_player.set_network_master(peer_id)
add_child(new_player)
func _on_Button_pressed():
Global.main_menu()