system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
anutorn |
I want something like…
If (this song is playing):
do something cool
The thing is I don’t know how to check songs name.
I need help.
Thank you
system
2
|
|
|
|
Reply From: |
Zylann |
AudioStreamPlayer
has a stream
property, which contains the currently played audio file: AudioStreamPlayer — Godot Engine (stable) documentation in English
You can check the file name this way:
if stream.resource_path == "res://path/to/your/sound.ogg":
...
If your script is not directly on the player:
var player = get_node("Path/To/The/PlayerNode")
if player.stream.resource_path == "res://path/to/your/sound.ogg":
...
Thank you so much!
anutorn | 2020-03-12 00:17