started working on bullets

This commit is contained in:
derek
2024-10-21 16:42:23 -05:00
parent 38da419c1c
commit d3d577a9c2
4 changed files with 19 additions and 19 deletions

View File

@@ -39,7 +39,7 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
func _physics_process(delta):
position += transform.basis * Vector3(0, 0, -bullet_speed) * delta
rotation.x = clamp(rotation.x - delta * bullet_drop,deg_to_rad(-90),deg_to_rad(90))

View File

@@ -178,8 +178,8 @@ func _physics_process(delta):
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
#movement in air
else:
velocity.x = lerp(velocity.x, direction.x * speed, delta * 3)
velocity.z = lerp(velocity.z, direction.z * speed, delta * 3)
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
velocity.z = lerp(velocity.z, direction.z * speed, delta * 6.5)
# Head bob
t_bob += delta * velocity.length() * float(is_on_floor())