added breakable objects
This commit is contained in:
16
scripts/broken_object_spawn.gd
Normal file
16
scripts/broken_object_spawn.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
Reference in New Issue
Block a user