WIP: Some updates
This commit is contained in:
parent
5ab840cdd8
commit
b6bf2b4616
@ -46,19 +46,17 @@ func _physics_process(delta: float) -> void:
|
|||||||
shared_node.velocity.y = consts.DEFAULT_JUMP_VELOCITY
|
shared_node.velocity.y = consts.DEFAULT_JUMP_VELOCITY
|
||||||
#if shooting:
|
#if shooting:
|
||||||
jumping = false
|
jumping = false
|
||||||
if multiplayer.is_server():
|
var direction := (shared_node.transform.basis * Vector3(input_direction.x, 0, input_direction.y)).normalized()
|
||||||
var direction := (shared_node.transform.basis * Vector3(input_direction.x, 0, input_direction.y)).normalized()
|
if shared_node.is_on_floor():
|
||||||
if shared_node.is_on_floor():
|
if direction:
|
||||||
if direction:
|
$SharedNode/Character/Model/AnimationPlayer.play("riffle_run")
|
||||||
$SharedNode/Character/Model/AnimationPlayer.play("riffle_run")
|
#first_view_legs_anim.play("Run Forward")
|
||||||
#first_view_legs_anim.play("Run Forward")
|
shared_node.velocity.x = direction.x * consts.DEFAULT_CHARACTER_SPEED
|
||||||
shared_node.velocity.x = direction.x * consts.DEFAULT_CHARACTER_SPEED
|
shared_node.velocity.z = direction.z * consts.DEFAULT_CHARACTER_SPEED
|
||||||
shared_node.velocity.z = direction.z * consts.DEFAULT_CHARACTER_SPEED
|
else:
|
||||||
else:
|
$SharedNode/Character/Model/AnimationPlayer.play("riffle_idle")
|
||||||
$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.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)
|
||||||
shared_node.velocity.z = move_toward(shared_node.velocity.z, 0, consts.DEFAULT_CHARACTER_SPEED)
|
|
||||||
sync_velocity.rpc(shared_node.velocity.x, shared_node.velocity.y, shared_node.velocity.z)
|
|
||||||
else:
|
else:
|
||||||
print(str(name) + str(shared_node.velocity))
|
print(str(name) + str(shared_node.velocity))
|
||||||
|
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_2dhi2"]
|
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_2dhi2"]
|
||||||
properties/0/path = NodePath("SharedNode:position")
|
properties/0/path = NodePath("SharedNode:position")
|
||||||
properties/0/spawn = true
|
properties/0/spawn = true
|
||||||
properties/0/replication_mode = 0
|
properties/0/replication_mode = 1
|
||||||
properties/1/path = NodePath("SharedNode:rotation")
|
properties/1/path = NodePath("SharedNode:rotation")
|
||||||
properties/1/spawn = true
|
properties/1/spawn = true
|
||||||
properties/1/replication_mode = 0
|
properties/1/replication_mode = 1
|
||||||
properties/2/path = NodePath(".:owner_id")
|
properties/2/path = NodePath(".:owner_id")
|
||||||
properties/2/spawn = true
|
properties/2/spawn = true
|
||||||
properties/2/replication_mode = 1
|
properties/2/replication_mode = 1
|
||||||
@ -24,6 +24,7 @@ script = ExtResource("1_bau14")
|
|||||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, 0)
|
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, 0)
|
||||||
|
|
||||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
||||||
|
replication_interval = 0.1
|
||||||
replication_config = SubResource("SceneReplicationConfig_2dhi2")
|
replication_config = SubResource("SceneReplicationConfig_2dhi2")
|
||||||
|
|
||||||
[node name="ReconciliationTimer" type="Timer" parent="."]
|
[node name="ReconciliationTimer" type="Timer" parent="."]
|
||||||
|
Loading…
Reference in New Issue
Block a user