Audiokinetic의 커뮤니티 Q&A는 사용자가 Wwise와 Strata 커뮤니티 내에서 서로 질문과 답변을 하는 포럼입니다. Audiokinetic의 기술 지원팀에게 문의하고 싶으신 경우 지원 티켓 페이지를 사용해주세요.

SetMultiplePositions() multidirection only applying the last position

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?
문의 2015 7월 22 General Discussion M.Bruno R. (300 포인트) 로 부터
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 :) 

 

답변 2018 12월 1 Slimane D. (170 포인트) 로 부터
...