13 lines
325 B
GDScript
13 lines
325 B
GDScript
extends Node3D
|
|
|
|
@onready var audio_player: ChangableAudioStreamPlayer3D = $ChangableAudioStreamPlayer3D
|
|
|
|
var is_playing: bool = false
|
|
|
|
func toggle():
|
|
is_playing = !is_playing
|
|
audio_player.do_play(3.5)
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
%Button.pressed.connect(toggle)
|