1
\$\begingroup\$

Conditional Music Playback

What's important here is that I know how to switch the track that's being played back to another if some condition is met in the scene. If possible I also want to know where to store the other tracks.

I looked into the documentation and have yet to find a solution that allows me to for example:

  • set the new track's file path and play it or...
  • store the track names in maybe an array and set them for playback in the script. (still requires something to change the currently playing track)

How do I switch the tracks based on any condition?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Set_stream(track)

where track is the audiostream object. It can be accessed by exporting the value with

export (AudioStream) var track 

And then selecting the track in the inspector.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ If this solved your problem, remember to click the checkmark to the left to mark the answer as "Accepted". \$\endgroup\$ Commented Mar 23, 2023 at 17:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.