WIP: Some updates
This commit is contained in:
parent
7341d4036d
commit
fa311dfb13
@ -57,14 +57,8 @@ func _physics_process(delta: float) -> void:
|
||||
$SharedNode/Character/Model/AnimationPlayer.play("riffle_idle")
|
||||
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)
|
||||
else:
|
||||
print(str(name) + str(shared_node.velocity))
|
||||
if multiplayer.is_server():
|
||||
shared_node.move_and_slide()
|
||||
shared_node.move_and_slide()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if not multiplayer.is_server():
|
||||
shared_node.move_and_slide()
|
||||
@rpc("any_peer", "call_local", "unreliable")
|
||||
func jump():
|
||||
jumping = true
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://clq0b7tbincut"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://clq0b7tbincut"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/player/server_node.gd" id="1_bau14"]
|
||||
[ext_resource type="PackedScene" uid="uid://cirun2v34nfpg" path="res://scenes/player/shared_node.tscn" id="1_ybp5y"]
|
||||
@ -18,6 +18,11 @@ properties/3/path = NodePath(".:input_direction")
|
||||
properties/3/spawn = true
|
||||
properties/3/replication_mode = 1
|
||||
|
||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_8la7e"]
|
||||
properties/0/path = NodePath("SharedNode:position")
|
||||
properties/0/spawn = true
|
||||
properties/0/replication_mode = 1
|
||||
|
||||
[node name="ServerNode" type="Node3D"]
|
||||
script = ExtResource("1_bau14")
|
||||
|
||||
@ -33,4 +38,8 @@ replication_config = SubResource("SceneReplicationConfig_2dhi2")
|
||||
wait_time = 0.1
|
||||
autostart = true
|
||||
|
||||
[node name="PositionSync" type="MultiplayerSynchronizer" parent="."]
|
||||
replication_interval = 0.1
|
||||
replication_config = SubResource("SceneReplicationConfig_8la7e")
|
||||
|
||||
[connection signal="timeout" from="ReconciliationTimer" to="." method="_on_reconciliation_timer_timeout"]
|
||||
|
Loading…
Reference in New Issue
Block a user