start Multiplayer

This commit is contained in:
2023-01-15 23:59:12 +01:00
parent 5cfc0839f7
commit 1ef5d54d6c
11 changed files with 209 additions and 255 deletions

View File

@@ -1,12 +1,19 @@
[gd_scene load_steps=6 format=3 uid="uid://bl7jynld7s25o"]
[gd_scene load_steps=10 format=3 uid="uid://bl7jynld7s25o"]
[ext_resource type="Script" path="res://scripts/player/PlayerQ3.gd" id="1"]
[ext_resource type="Script" path="res://scripts/player/Weapons.gd" id="2_dl1i1"]
[ext_resource type="Texture2D" uid="uid://17b1nu8spjfi" path="res://textures/icon.png" id="2_mxb5i"]
[ext_resource type="Shader" path="res://assets/shader/crosshair.gdshader" id="3_3vnqi"]
[sub_resource type="CylinderShape3D" id="1"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_resyc"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_mqdp4"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d6dov"]
albedo_texture = ExtResource("2_mxb5i")
uv1_scale = Vector3(3, 2, 1)
[sub_resource type="CylinderMesh" id="CylinderMesh_j6ixa"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qn642"]
shader = ExtResource("3_3vnqi")
shader_parameter/center_enabled = null
shader_parameter/legs_enabled = null
@@ -21,23 +28,39 @@ shader_parameter/len = null
shader_parameter/spacing = null
shader_parameter/spread = null
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_36ekt"]
properties/0/path = NodePath(".:position")
properties/0/spawn = true
properties/0/sync = true
properties/1/path = NodePath("Body:rotation")
properties/1/spawn = true
properties/1/sync = true
properties/2/path = NodePath("Body/Head:rotation")
properties/2/spawn = true
properties/2/sync = true
[node name="PlayerQ3" type="CharacterBody3D"]
script = ExtResource("1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("1")
shape = SubResource("CylinderShape3D_resyc")
[node name="MeshInstance3D" type="MeshInstance3D" parent="CollisionShape3D"]
material_override = SubResource("StandardMaterial3D_d6dov")
mesh = SubResource("CylinderMesh_j6ixa")
[node name="Body" type="Node3D" parent="."]
[node name="Head" type="Node3D" parent="Body"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.75, 0)
[node name="Hand" type="Node3D" parent="Body/Head"]
[node name="Hand" type="Node3D" parent="Body/Head" node_paths=PackedStringArray("player_root")]
script = ExtResource("2_dl1i1")
player_root = NodePath("../../..")
[node name="Crosshair" type="ColorRect" parent="Body/Head/Hand"]
material = SubResource("ShaderMaterial_mqdp4")
material = SubResource("ShaderMaterial_qn642")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@@ -51,3 +74,16 @@ current = true
[node name="AimCast" type="RayCast3D" parent="Body/Head/Camera3D"]
target_position = Vector3(0, 0, -1)
collision_mask = 512
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Label" type="Label" parent="CanvasLayer"]
offset_right = 40.0
offset_bottom = 14.0
metadata/_edit_use_anchors_ = true
[node name="Networking" type="Node" parent="."]
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="Networking"]
root_path = NodePath("../..")
replication_config = SubResource("SceneReplicationConfig_36ekt")