Hi,
I'm working in Unity 5.2.1, Wwise 2015.1.2 on Unity's "Into the Space" Demo project (
https://www.assetstore.unity3d.com/en/#!/content/20749). The game is a basic galaga clone, you control a player ship while enemy ships drop down the screen.
I have a space engine sound (Wwise pink noise generator, if it matters) I'm trying to pan based on the position an enemy ship is instantiated on the X-axis.
I've set up a "RedShipPanning" Game Parameter which takes the ship's X-axis coordinate on start (I'll post the code below), this has a min/max value of -6/6 and defaults to zero (based off Unity's coordinates). This parameter modifies the 2D panning RTPC on the engine sound itself, and does so just fine for a single object on the screen at a time.
However when a 2nd red ship is instantiated, the existing RTPC's value changes to match with the new ship's X-axis coordinate instead of having the RTPC act on a per-object basis. So a ship to the right 3/4 the way down the screen suddenly jumps to the left as a new ship appears on that side at the top of the screen. Super annoying. Am I confusing how RTPC's should actually behave? It's like they're acting as a mix buss instead of an effect on a specific object.
Here is the Unity code:
// Use this for initialization
void Start ()
{
GetComponent<Rigidbody2D>().velocity = -1 * transform.up * speed; //Enemy Ship Movement
AkSoundEngine.SetRTPCValue ("RedShipPanning", transform.position.x); //Set Wwise's "RedShipPanning" RTPC value based on the ship's initial x-coordinate
}
I have also attempted to add an object ID to the SetRTPCValue code, and this hasn't changed anything.
A friend mentioned this might be an issue to the game object being cloned in Unity - but I'm unfamiliar with exactly how that process works and affects Wwise.
Halp! Thanks :)