WIP: Some updates
This commit is contained in:
parent
6ad263e081
commit
6528957ce1
@ -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
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user