IT WORKSSSSSS

This commit is contained in:
Chris Bell 2024-12-15 14:56:08 -06:00
parent c04b596740
commit e6288189ca
2 changed files with 8 additions and 9 deletions

View File

@ -372,11 +372,13 @@ func _on_game_started():
var player: Player = player_scene.instantiate()
player.name = "Player_" + str(member["steam_id"])
player.username = Steam.getFriendPersonaName(member["steam_id"])
level.add_child(player)
if member["steam_id"] == steam_id:
player.is_network_authority = true
else:
player.is_network_authority = false
level.add_child(player)
func sync_property(node_id: String, property_name: String, value: Variant):

View File

@ -34,18 +34,15 @@ var previous_global_rotation: Vector3
func _ready() -> void:
NetworkManager.property_update_received.connect(_on_property_update)
NetworkManager.register_node(self)
network_uuid = NetworkManager.register_node(self)
func _enter_tree() -> void:
player_tag = get_node("PlayerTag")
player_tag.text = username
if is_network_authority:
camera.current = true
capture_mouse()
if is_network_authority:
camera.make_current()
func _unhandled_input(event: InputEvent) -> void:
if !is_network_authority: return
if Input.mouse_mode == Input.MOUSE_MODE_CAPTURED: