WIP: Some updates

This commit is contained in:
Nikolai Rodionov 2025-02-09 21:43:27 +01:00
parent 6ad263e081
commit 6528957ce1
Signed by: allanger
GPG Key ID: 09F8B434D0FDD99B
2 changed files with 6 additions and 3 deletions

View File

@ -56,8 +56,14 @@ func _physics_process(delta: float) -> void:
else:
shared_node.velocity.x = move_toward(shared_node.velocity.x, 0, consts.DEFAULT_CHARACTER_SPEED)
shared_node.velocity.z = move_toward(shared_node.velocity.z, 0, consts.DEFAULT_CHARACTER_SPEED)
if multiplayer.is_server():
update_position.rpc(shared_node.global_position)
shared_node.move_and_slide()
@rpc("authority", "call_remote", "unreliable_ordered")
func update_position(real_position: Vector3):
shared_node.global_position = lerp(shared_node.global_position, real_position, 1.0)
@rpc("any_peer", "call_local", "unreliable")
func jump():
jumping = true

View File

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