adj: projectile physics when moving backwards
This commit is contained in:
@@ -88,8 +88,6 @@ func _spawn_custom_projectile(origin: Vector3, fire_dir: Vector3) -> void:
|
||||
|
||||
var light = OmniLight3D.new()
|
||||
light.light_color = Color(0.2, 0.6, 1.0)
|
||||
light.light_energy = 2.0
|
||||
light.omni_range = 4.0
|
||||
proj.add_child(light)
|
||||
|
||||
proj.position = muzzle_flash.global_position if muzzle_flash else origin
|
||||
@@ -97,13 +95,15 @@ func _spawn_custom_projectile(origin: Vector3, fire_dir: Vector3) -> void:
|
||||
|
||||
proj.velocity = fire_dir * projectile_speed
|
||||
if player:
|
||||
proj.velocity += fire_dir * player.velocity.dot(fire_dir)
|
||||
proj.velocity += fire_dir * max(0.0, player.velocity.dot(fire_dir))
|
||||
proj.damage = base_damage
|
||||
proj.min_damage = min_damage
|
||||
proj.falloff_start = falloff_start
|
||||
proj.max_range = max_range
|
||||
proj.drop_gravity = projectile_gravity
|
||||
proj.owner_player = player
|
||||
light.light_energy = 2.0
|
||||
light.omni_range = 4.0
|
||||
proj.impact_type = "plasma"
|
||||
|
||||
# Spawn in the world
|
||||
|
||||
Reference in New Issue
Block a user