menu
 

AudiokineticのコミュニティQ&AはWwiseやStrataのコミュニティ内でユーザ同士が質問・回答をし合うことができるフォーラムです。Audiokineticテクニカルサポートチームからの回答をご希望の場合は、必ず サポートチケットページ をご利用ください。

0 支持

I have had good success posting events in Unity with this line of code when a specific function or event is triggered by a button press etc.

AkSoundEngine.PostEvent("MyEvent", this.gameObject);

This is NOT working when I want the event to start "on AWake"

Here is the script - and I was told to put the event on awake
 

  private void Awake()
    {
        Screen.orientation = ScreenOrientation.LandscapeLeft;

        currentBlimpTarget = blimpEndPoint;

etc.......

Can someone tell me where the AkSoundEngine.PostEvent should go?
Or is there a different line of code I should use for an Event that it to be played "on awake"?
 

 

 

Tom D. (180 ポイント) General Discussion

回答 1

0 支持

Hey Tom, 

Any reason you don't just post the Event in Start()? 
Usually, it's recommended to load SoundBanks in Awake(), then post sounds in Start(). This ensures that the SoundBanks is loaded before you post the Event. 

That said, for these types of problems the Profiler's Capture Log is the best place to go. If you need to connect before the game starts, you can always connect to the IP 127.0.0.1 (your local IP) and upon starting the game, Wwise will automatically find it and connect. 

Mads Maretty S. (Audiokinetic) (40.2k ポイント)
...