コミュニティQ&A

Audiokineticのコミュニティ主導のQ&Aフォーラムへようこそ。ここはWwiseとStrataのユーザのみなさまがお互いに協力し合う場です。弊社チームによる直接のサポートをご希望の場合はサポートチケットページをご利用ください。バグを報告するには、Audiokinetic LauncherのBug Reportオプションをご利用ください。(Q&AフォーラムではBug Reportを受け付けておりませんのでご注意ください。専用のBug Reportシステムをご利用いただくことで、バグの報告が適切な担当部門に届き、修正される可能性が高まります。)

最適な回答を迅速に得られるよう、ご質問を投稿される際は以下のヒントをご参考ください。

  • 具体的に示す:何を達成したいのか、またはどんな問題に直面しているのかを具体的に示してください。
  • 重要な詳細情報を含める:Wwiseとゲームエンジンのバージョンやご利用のOSなど詳細情報を記載してください。
  • 試したことを説明する:すでに試してみたトラブルシューティングの手順を教えてください。
  • 事実に焦点を当てる:問題の技術的な事実を記載してください。問題に焦点を当てることで、ほかのユーザのみなさまが解決策を迅速に見つけやすくなります。

0 支持
Problem with silence in interactive music using switches in Unity

Nice to meet you.
I would like to use Wwise's Switch on an enemy object in Unity to switch songs.

I have attached a Collider to the Enemy object, and InTrigger to switch the Switch when the Player object gets in range.
However, when the Player enters the range, the song switches, but when the Player goes out of range, the song is silent.

EventName is BGM and SwitchGroup is Field, switch is Nomal_Field and Enemy_Field.
To explain with switches, I want Unity to switch to Nomal_Field when playing, Enemy_Field when in range of an enemy, and Nomal_Field when out of range of an enemy.

The current situation is as follows
Unity version:2022.3.35f1
Wwise Version:2023.1.5.8522

WwiseGlobal
AkEvent→Trigger On:Start, Name:BGM
AkSwitch→Trigger On:Start, Name;Field/Nomal_Field
AkGameObj→Attenuation Scaling Factor:1, Only Use DefaulListeners is checked

Enemy Objects
WwiseSwitch.cs

using System.Collections;.
Generic; using System.Collections.
Generic; using UnityEngine; using UnityEngine.

public class WwiseSwitch : MonoBehaviour
{
    public GameObject SwitchGameobject; public string EnemyFieldSwitchName = EnemyFieldSwitchName
    public string EnemyFieldSwitchName = “Enemy_Field”;
    public string NormalFieldSwitchName = “Normal_Field”;

    // Start is called before the first frame update
    void Start()
    {
       
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == “Player”)
        {
            
            AkSoundEngine.SetSwitch(“Field”, EnemyFieldSwitchName, SwitchGameobject); }
           
        }
    }

    private void OnTriggerExit(Collider other)
    {
        if (other.tag == “Player”)
        {
            AkSoundEngine.SetSwitch(“Field”, NormalFieldSwitchName, SwitchGameobject); }
           
        }
    }
}

Anything I'm missing, please ask.
Thank you in advance for your response.
遥大 本間 (100 ポイント) General Discussion

Please sign-in or register to answer this question.

...