Arrow

mail@pastecode.io avatar
unknown
plain_text
5 months ago
463 B
12
Indexable
extends RigidBody3D

@onready var destroy_timer: Timer = $DestroyTimer
@export var hit_sound: AudioStreamPlayer3D

func _on_body_entered(body: Node) -> void:
	destroy_timer.start()
	if body is Monster:
		body.in_agro_range = true
		body.recieve_damage(GameManager.get_weapon_damage())
		hit_sound.play()
		call_deferred("disable_collision")

#Disable arrow collission for monster after 1st hit
func disable_collision() -> void:
	set_collision_mask_value(3, false)
Leave a Comment