WIP: Migrating to node3ds

This commit is contained in:
Nikolai Rodionov 2025-02-09 22:50:43 +01:00
parent 5a0e3cc6b9
commit 691e0ea8bc
Signed by: allanger
GPG Key ID: 09F8B434D0FDD99B
2 changed files with 2 additions and 3 deletions

View File

@ -44,7 +44,6 @@ func _physics_process(delta: float) -> void:
if not shared_node.is_on_floor():
shared_node.velocity += shared_node.get_gravity() * delta
if shared_node.is_on_floor() && jumping:
print("jumping" + str(name))
shared_node.velocity.y = consts.DEFAULT_JUMP_VELOCITY
jumping = false
var direction := (shared_node.transform.basis * Vector3(input_direction.x, 0, input_direction.y)).normalized()
@ -60,9 +59,10 @@ func _physics_process(delta: float) -> void:
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)
shared_node.global_position = lerp(shared_node.global_position, real_position, 10.0)
@rpc("any_peer", "call_local", "unreliable")
func jump():

View File

@ -19,7 +19,6 @@ var can_shoot: bool = true
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
cooldown_timer.wait_time = cooldown
print("test")
@onready var bullet_trace_distance: Node3D = $BulletTraceDistance