diff --git a/scenes/molikman.tscn b/scenes/molikman.tscn index fbffb49..fc594e7 100644 --- a/scenes/molikman.tscn +++ b/scenes/molikman.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=82 format=4 uid="uid://dpsr6ug3pkb40"] +[gd_scene load_steps=83 format=4 uid="uid://dpsr6ug3pkb40"] [ext_resource type="Script" uid="uid://3dphlay25fih" path="res://scripts/player/player.gd" id="1_g2els"] [ext_resource type="Script" uid="uid://dalwlndejfdhm" path="res://scripts/player/crosshair.gd" id="3_dqkch"] @@ -7401,6 +7401,14 @@ _data = { &"baked_sp_shoot_empty": SubResource("Animation_do7kw") } +[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_b2eak"] +properties/0/path = NodePath(".:rotation") +properties/0/spawn = true +properties/0/replication_mode = 1 +properties/1/path = NodePath("..:rotation") +properties/1/spawn = true +properties/1/replication_mode = 1 + [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_g2els"] height = 1.2958984 @@ -7411,24 +7419,21 @@ font_size = 32 properties/0/path = NodePath(".:position") properties/0/spawn = true properties/0/replication_mode = 1 -properties/1/path = NodePath(".:rotation") +properties/1/path = NodePath(".:hp") properties/1/spawn = true properties/1/replication_mode = 1 -properties/2/path = NodePath(".:hp") +properties/2/path = NodePath(".:team") properties/2/spawn = true -properties/2/replication_mode = 1 -properties/3/path = NodePath(".:team") +properties/2/replication_mode = 2 +properties/3/path = NodePath(".:player_id") properties/3/spawn = true -properties/3/replication_mode = 2 -properties/4/path = NodePath(".:player_id") +properties/3/replication_mode = 0 +properties/4/path = NodePath(".:collision_layer") properties/4/spawn = true properties/4/replication_mode = 0 -properties/5/path = NodePath(".:collision_layer") +properties/5/path = NodePath(".:collision_mask") properties/5/spawn = true properties/5/replication_mode = 0 -properties/6/path = NodePath(".:collision_mask") -properties/6/spawn = true -properties/6/replication_mode = 0 [sub_resource type="Curve" id="Curve_fbysy"] _data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 2.5229826, 0.0, 0, 0] @@ -8591,6 +8596,9 @@ script = ExtResource("4_smehm") fov = 90.0 script = ExtResource("8_rwwcc") +[node name="CameraSync" type="MultiplayerSynchronizer" parent="Camera3D"] +replication_config = SubResource("SceneReplicationConfig_b2eak") + [node name="StandArea" type="Area3D" parent="."] collision_layer = 0 diff --git a/scripts/player/player.gd b/scripts/player/player.gd index 4594846..02b87fa 100644 --- a/scripts/player/player.gd +++ b/scripts/player/player.gd @@ -8,6 +8,7 @@ class_name Player set(id): player_id = id $PlayerInput.set_multiplayer_authority(id) + $Camera3D.set_multiplayer_authority(id) var passived: bool = false diff --git a/scripts/weapon_system/weapon_system.gd b/scripts/weapon_system/weapon_system.gd index 6c63a6d..e896000 100644 --- a/scripts/weapon_system/weapon_system.gd +++ b/scripts/weapon_system/weapon_system.gd @@ -78,8 +78,6 @@ func switch(to: StringName, exit: bool = true): ammo_updated.emit(current_state.ammo,current_state.remaining_ammo) switched_to.emit(current_state) - - update_remotes.rpc(to,exit) func return_to_previous(exit: bool = true): if last_slot != "": @@ -87,15 +85,6 @@ func return_to_previous(exit: bool = true): else: switch("knife", exit) -@rpc("authority","call_remote","reliable") -func update_remotes(to: StringName,exit: bool): - if current_state != null and exit: - current_state.exit() - current_state = slots[to] - current_state.enter() - - switched_to.emit(current_state) - func drop_current(): drop(current_state)