Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

0 votes
I am able to call an event i created which changes a RTPC value, but only when i attach this event to a game object. I cant figure out how to call, activate, this event  with key input.

Any ideas what i need to declare or set? Im not familiar with the AK. api.

Thanks in advance.
in General Discussion by ian s. (100 points)

1 Answer

0 votes

You need some scripts, No No NO don't run, take it easy.

Create a new script, attach it to an empty gameobject 

Imagine this gameobject is your keys input manager. 

Script:

using UnityEngine;             // mandatory
using System.Collections;  // mandatory... i think

public class test : MonoBehaviour {        // NAME OF THE CLASS MUST BE THE SAME AS THE FILENAME; Here; test.cs

    void Update () {                     // Called each frame
        float rtpcValueToSend = 22;     // set the rtpc as you which, value is declared as a float, no need to write 22f
        if (Input.GetKey ("up")) {        // will execute the next commands in {} if the up key is pressed
            AkSoundEngine.SetRTPCValue ("nameofyourrtpc", rtpcValueToSend); // send rtpc to wwise
        }
    }
}

 

 You should look at AkSoundEngine class, most functions are called with this class,

for example, AksoundEngine.PostEvent("play_Footstep, gameObject) 

by olivier h. (290 points)
edited by olivier h.
...