Search code examples
augmented-realityarkitrealitykitreality-composer

In Reality Composer, how can I stop a sound?


Say I have 2 buttons, each triggers a piece of music.

How do I have Button A stop the music that was triggered by Button B and vice versa?

Not seeing the option for Sound, Music, or Ambience.


Solution

  • Playing/Stopping audio with one 3D button

    In macOS RC, create 2 scenes – first with stop button, and second with play button.

    enter image description here

    Then, apply the Tap trigger and Change Scene action to custom Behavior of the 1st scene:

    enter image description here

    And apply the corresponding triggers and actions to 2 simultaneous behaviors of the 2nd scene:

    enter image description here


    enter image description here

    Now, when you tap the buttons, sound plays/stops as expected.

    enter image description here