Armazon/scripts/gun_tip.gd
2024-01-28 13:44:54 -05:00

14 lines
308 B
GDScript

extends Node3D
const gunblast = preload("res://props/explosion/gun_blast.tscn")
@export var chance: float = 0.1
func _on_collide(_f: float):
if randf() < chance:
add_child(gunblast.instantiate())
$gunshot.visible = true
$Timer.start(0.1)
func _on_timer_timeout() -> void:
$gunshot.visible = false