more tweaks
This commit is contained in:
@@ -9,6 +9,7 @@ var bullet_force_mod = 1.0
|
||||
var distance_from_player
|
||||
var player_position
|
||||
var player_velocity
|
||||
var bullet_active = true
|
||||
|
||||
@onready var mesh = $Cylinder
|
||||
@onready var particles = $GPUParticles3D
|
||||
@@ -37,7 +38,7 @@ func _physics_process(delta):
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
|
||||
if !body.is_in_group("player"):
|
||||
if !body.is_in_group("player") and bullet_active:
|
||||
print("BODY HIT - " + str(body))
|
||||
|
||||
#Break Breakable Objects
|
||||
@@ -47,8 +48,6 @@ func _on_body_entered(body: Node) -> void:
|
||||
if body.is_in_group("switch"):
|
||||
body.hit()
|
||||
|
||||
mesh.visible = false
|
||||
|
||||
if ray.is_colliding() and !ray.get_collider().is_in_group("player"):
|
||||
#Bullet Hole Effect
|
||||
ray.get_collider().add_child(instance_bullethole)
|
||||
@@ -65,4 +64,8 @@ func _on_body_entered(body: Node) -> void:
|
||||
SignalBus.emit_signal("enemy_hit")
|
||||
ray.get_collider().hit(bullet_damage)
|
||||
|
||||
mesh.visible = false
|
||||
bullet_active = false
|
||||
particles.emitting = true
|
||||
await get_tree().create_timer(1).timeout
|
||||
queue_free()
|
||||
|
||||
Reference in New Issue
Block a user