diff --git a/Makefile b/Makefile index eb2149c..f59b0de 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ JOLT_VERSION = v0.14.0-stable JOLT_URL = https://github.com/godot-jolt/godot-jolt/releases/download/${JOLT_VERSION}/godot-jolt_${JOLT_VERSION}.zip JOLT_DIR = ./godot/jolt + install_jolt: rm -rf ${JOLT_DIR} $(eval DOWNLOAD := $(shell mktemp -d)) diff --git a/godot/scenes/characters/character_wrapper.gd b/godot/scenes/characters/character_wrapper.gd index bb0d46b..c8df8c9 100644 --- a/godot/scenes/characters/character_wrapper.gd +++ b/godot/scenes/characters/character_wrapper.gd @@ -16,8 +16,8 @@ func _ready() -> void: func _process(delta: float) -> void: set_multiplayer_authority(multiplayer.get_unique_id()) if owner_placeholder: - global_transform = owner_placeholder.shared_node.global_transform - global_rotation = owner_placeholder.shared_node.global_rotation + global_transform = owner_placeholder.global_transform + global_rotation = owner_placeholder.global_rotation # Set the owner placeholder, so the characters can send the requests to a node # it depends on func set_owner_placeholder(owner: Node3D): diff --git a/godot/scenes/player/server_node.gd b/godot/scenes/player/server_node.gd index 405eeec..4319afa 100644 --- a/godot/scenes/player/server_node.gd +++ b/godot/scenes/player/server_node.gd @@ -23,6 +23,12 @@ func _ready() -> void: shared_node.set_collision_mask_value(3, true) map_controller = find_parent("Map") _load_weapon() + var model_scene: PackedScene = ResourceLoader.load("res://scenes/characters/y-bot/character.tscn") + var model: CharacterWrapper = model_scene.instantiate() + model.global_position = shared_node.global_position + model.set_owner_placeholder(shared_node) + shared_node.add_child(model) + # Load the default weapon and set the current attack properties func _load_weapon() -> void: diff --git a/godot/scenes/player/server_node.tscn b/godot/scenes/player/server_node.tscn index ab98bdd..f089273 100644 --- a/godot/scenes/player/server_node.tscn +++ b/godot/scenes/player/server_node.tscn @@ -24,7 +24,7 @@ properties/4/replication_mode = 2 [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_8la7e"] properties/0/path = NodePath("SharedNode:position") properties/0/spawn = true -properties/0/replication_mode = 2 +properties/0/replication_mode = 0 [node name="ServerNode" type="Node3D"] script = ExtResource("1_bau14") @@ -33,6 +33,7 @@ script = ExtResource("1_bau14") [node name="Character" parent="SharedNode" instance=ExtResource("3_eykxo")] transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, 0) +visible = false [node name="MainSynchronizer" type="MultiplayerSynchronizer" parent="."] replication_config = SubResource("SceneReplicationConfig_2dhi2") diff --git a/godot/scenes/weapon/guns/ak/with_hands.tscn b/godot/scenes/weapon/guns/ak/with_hands.tscn index 4938cd7..6758831 100644 --- a/godot/scenes/weapon/guns/ak/with_hands.tscn +++ b/godot/scenes/weapon/guns/ak/with_hands.tscn @@ -639,6 +639,7 @@ _data = { } [node name="WithHands" type="Node3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.528017, -0.924033, 0) script = ExtResource("1_h1xyo") damage = 50 cooldown = 0.15