menu
 

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

0 支持
Hi!
I'm using the SetMultiplePositions function, but It's only getting the last position from the array.
That's the code I have

AKRESULT success = AK::SoundEngine::SetMultiplePositions(
            staticObj.getId(), //id of the object within wwise
            staticObj.getPositions().data(), //getPositions() returns an std::vector. this converts std::vector to array
            staticObj.getPositions().size(), //number of positions passed within the array
            AK::SoundEngine::MultiPositionType::MultiPositionType_MultiDirections
            );

Does anyone have this problem too? Am I doing anything wrong?
M.Bruno R. (300 ポイント) General Discussion
Did you manage to find a solution for this, we're having a similar issue where the event only plays on the root object. Here's the code, would be great if someone could look at it.

        //River to array
        AkPositionArray arr = new AkPositionArray((uint)river.transform.childCount);
        foreach( Transform child in river.transform) {
            Vector3 pos = child.position;
            Vector3 forw = child.forward;
            Vector3 up = child.up;
            arr.Add(pos, forw, up);
        }
        AkSoundEngine.SetMultiplePositions(river,arr, (ushort)river.transform.childCount, MultiPositionType.MultiPositionType_MultiSources);
        AkSoundEngine.PostEvent("ambient_river", river);
Hi! Honestly, I can't remember. This was year and half ago. I can check the code (I still have it) and see what I did to solve this (if I did).
Do you still need it?
Hi, thanks for the reply. I eventually managed to solve this issue :)
Hi! I just checked and we didn't solve it, we did a workaround. If you can, please, post your solution.
Thank you!

回答 1

+1 支持

I don't know if it still might help, but i've been trying to set the multiposition mode using code as well, and I managed to do it. 
I've checked the code of AkAmbient.cs (Unity) and I noticed that, before setting the multiposition mode for a gameobject, all components of type "AkGameObj" are removed.

AkGameObj[] gameObj = soundpoint.gameObject.GetComponents<AkGameObj>();
for (int i = 0; i < gameObj.Length; i++)
    gameObj[i].enabled = false;

I added this portion of code in my soundmanager, before setting the multiposition mode, and now it works :) 

 

Slimane D. (170 ポイント)
...