class_name SpraySFX extends AudioStreamPlayer3D
## Plays only as long as `activate` is called every frame.

var _active_this_frame := false


func activate() -> void:
	_active_this_frame = true


func _process(_delta: float) -> void:
	if _active_this_frame:
		if not playing:
			play()
	else:
		stop()

	_active_this_frame = false
