Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes

Hello all. I've been working on replacing all the audio in the 3d Game Kit through Wwise integration and am fairly new to coding. I am working on the sounds of an energy grenade exploding and bouncing. In the original script for the grenade they declare 2 RandomAudioPlayers:

public RandomAudioPlayer explosionPlayer;

public RandomAudioPlayer bouncePlayer;

Then later in the script the Explosion function starts of like this:

public void Explosion() {

if (explosionPlayer) {

explosionPlayer.transform.SetParent(null);

explosionPlayer.PlayRandomClip();

} .....

I am attempting to replace these lines as follows, first I declare 3 things at the beginning:

public AK.Wwise.Event aKExplosion;

public AK.Wwise.Event aKBounce;

private AkGameObj grenadeLocation;

Then later I replace the original lines in the function with:

public void Explosion() {

if (grenadeLocation) {

grenadeLocation.transform.SetParent(null);

aKExplosion.Post(gameObject);

} .....

I'm not getting any errors in the script but also no sound from the explosion... I'm not sure AkGameObject is the correct class to use here but so far I have not come up with any better ideas and have hit a wall. Any help or suggestions would be greatly appreciated. Also let me know if I should elaborate on any aspect. Thanks!!

in General Discussion by Jon S. (100 points)

Please sign-in or register to answer this question.

...