multyplayer

This commit is contained in:
algodoogle
2026-07-16 18:36:49 +01:00
parent 5e0b58a984
commit 1869dbf054
28 changed files with 974 additions and 60 deletions
+5
View File
@@ -23,6 +23,11 @@ func _ready() -> void:
func _on_body_entered(body: Node3D) -> void:
# Container fill mutates world state (reparent/freeze); run only on the
# world owner. Item transforms replicate to clients via each item's
# MultiplayerSynchronizer (global_transform), so contents follow the plate.
if not NetworkManager.owns_world():
return
if not body.is_in_group(target_group):
return
+12
View File
@@ -7,6 +7,12 @@
[ext_resource type="Script" uid="uid://dvobm6vcfnqe8" path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" id="4_dhtvl"]
[ext_resource type="PackedScene" uid="uid://ctw7nbntd5pcj" path="res://addons/godot-xr-tools/objects/grab_points/grab_point_hand_right.tscn" id="5_vlcpl"]
[ext_resource type="Animation" uid="uid://d1xnpyc08njjx" path="res://addons/godot-xr-tools/hands/animations/right/Grip 4.res" id="6_el51w"]
[ext_resource type="Script" path="res://Prefabs/net_pickable.gd" id="7_net"]
[sub_resource type="SceneReplicationConfig" id="Repl_item"]
properties/0/path = NodePath(".:global_transform")
properties/0/spawn = true
properties/0/replication_mode = 1
[sub_resource type="CylinderShape3D" id="CylinderShape3D_kek77"]
height = 0.0635376
@@ -61,6 +67,12 @@ hand_pose = SubResource("Resource_2hcq0")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.16517048, 0.042291984, -0.08604182)
hand_pose = SubResource("Resource_dlngj")
[node name="NetPickable" type="Node" parent="."]
script = ExtResource("7_net")
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("Repl_item")
[node name="Container" parent="." unique_id=377793422 node_paths=PackedStringArray("meal_positions", "side_positions") instance=ExtResource("1_s5yhh")]
target_group = "platalbe_item"
meal_positions = [NodePath("MealPositions/Slot1")]