quick tweaks

This commit is contained in:
derek
2024-07-22 17:04:04 -05:00
parent a7b8613329
commit 356455ba29
3 changed files with 6 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ var instance_bullethole
var bullet_force_mod = 1.0
var distance_from_player
var player_position
var player_velocity
@onready var mesh = $gunbullet1
@onready var ray = $RayCast3D
@@ -40,6 +41,7 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position += transform.basis * Vector3(0, 0, -bullet_speed) * delta
print(player_velocity)
rotation.x = clamp(rotation.x - delta * bullet_drop,deg_to_rad(-90),deg_to_rad(90))
distance_from_player = abs(self.global_position - player_position)

View File

@@ -100,6 +100,7 @@ func shoot(delta):
else:
instance_bullet.transform.basis = barrel_raycast.global_transform.basis
instance_bullet.bullet_speed = bullet_speed
instance_bullet.player_velocity = player.velocity.length()
instance_bullet.bullet_drop = bullet_drop
instance_bullet.random_spread_amt = random_spread_amt
instance_bullet.bullet_damage = bullet_damage