17 lines
410 B
GDScript
17 lines
410 B
GDScript
extends Node3D
|
|
|
|
@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
|