WIP: Migrating to node3ds

This commit is contained in:
2025-02-09 23:52:16 +01:00
parent e77a828fca
commit 556f0dbb27
3 changed files with 3 additions and 8 deletions

View File

@@ -57,12 +57,10 @@ func _physics_process(delta: float) -> void:
shared_node.velocity.z = move_toward(shared_node.velocity.z, 0, consts.DEFAULT_CHARACTER_SPEED)
shared_node.move_and_slide()
@rpc("authority", "call_remote", "unreliable_ordered")
func update_position(real_position: Vector3):
if not multiplayer.is_server():
shared_node.global_position = lerp(shared_node.global_position, real_position, 1.0)
shared_node.global_transform.origin = lerp(shared_node.global_transform.origin, real_position, 1.0)
@rpc("any_peer", "call_local", "unreliable")
func jump():
@@ -89,7 +87,7 @@ func set_rotation_y(y: float):
func _on_reconciliation_timer_timeout() -> void:
if multiplayer.is_server():
_veryfy_position_and_rotation.rpc_id(owner_id)
#update_position.rpc(shared_node.global_position)
update_position.rpc(shared_node.global_transform.origin)
$ReconciliationTimer.start()
@rpc("any_peer", "call_local", "reliable")

View File

@@ -16,9 +16,6 @@ properties/2/replication_mode = 1
properties/3/path = NodePath(".:jumping")
properties/3/spawn = true
properties/3/replication_mode = 2
properties/4/path = NodePath("SharedNode:position")
properties/4/spawn = true
properties/4/replication_mode = 1
[node name="ServerNode" type="Node3D"]
script = ExtResource("1_bau14")