Files
fps_project_1/scripts/broken_object_spawn.gd
2024-07-16 16:52:06 -05:00

22 lines
477 B
GDScript

extends Node3D
@export var timer : Node
@export var sound : Node
@export var pitch_scale_amt = .5
var rng = RandomNumberGenerator.new()
# Called when the node enters the scene tree for the first time.
func _ready():
if sound != null:
sound.pitch_scale = 1 + rng.randf_range(-pitch_scale_amt,pitch_scale_amt)
sound.play()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_timer_timeout():
queue_free()