커뮤니티 Q&A

Audiokinetic의 커뮤니티 Q&A 포럼에 오신 것을 환영합니다. 이 포럼은 Wwise와 Strata 사용자들이 서로 도움을 주는 곳입니다. Audiokinetic의 직접적인 도움을 얻으려면 지원 티켓 페이지를 사용하세요. 버그를 보고하려면 Audiokinetic 런처에서 Bug Report 옵션을 사용하세요. (Q&A 포럼에 제출된 버그 보고는 거절됩니다. 전용 Bug Report 시스템을 사용하면 보고 내용이 담당자에게 정확히 전달되어 문제 해결 가능성이 크게 높아집니다.)<segment 6493>

빠르고 정확한 답변을 얻으려면 질문을 올릴 때 다음 팁을 참고하세요.

  • 구체적인 내용을 적어주세요: 무엇을 하려는지, 혹은 어떤 특정 문제에 부딪혔는지 설명하세요.
  • 핵심 정보를 포함하세요: Wwise와 게임 엔진 버전, 운영체제 등 관련 정보를 함께 제공하세요.
  • 시도한 방법들을 알려주세요: 문제 해결을 위해 이미 어떤 단계를 시도해봤는지 설명해주세요.
  • 객관적인 사실에 초점을 맞추세요: 문제의 기술적 사실을 중심으로 설명하세요. 문제에 집중할수록 다른 사람들이 더 빠르게 해결책을 찾을 수 있습니다.

+1 투표
Hello everyone! I am doing some testing on the Unity 3D Game Kit project from Unity Market Place using Unity 2020.2.1f1 (along with Wwise 2019.8.7432) and for some reason i CAN'T make a basic Ak Event "Trigger on: Start" works. Been doing it in several projects for the last 2 years but doesnt seem to work on this version! As always i checked the Rigidbody on my Player Game Object (Ellen), created a trigger box (Is Trigger) added the Ak Trigger Enter/Trigger Exit component targeting the Player Game Object...All the steps we are suppose to follow to trigger something on a trigger but not working :/.

Its really basic but still can't find a way to work around and it's blocking a lot of features i want to try with Ak Environment/Switches/States etc....

Do someone as something in mind that i might have missed ?

Thanks
General Discussion Angel I. (130 포인트) 로 부터
Hi Angel, I am also having this problem, the Ellen character is as you describe and it does not trigger the collider, which I have set up just like you... my problem in addition to this is that I am new to this scripting so I don't have experience of debugging the scripts. I tried with the script from the 301 Certification that checks for the Player tag and triggers on enter and exit and I get no errors on the console, I have checked many times and it should work... I am also on Unity 2020.2.2f1 but WWISE 2019.2.9

Please, if you have solved this problem, can you let me know how? It must be something to do with the Ellen character... all else works fine!

Thanks,
Julio

2 답변

0 투표
Hey Angel,

That's strange. Have you tried creating a custom script and test if Start() is called?

All of those Trigger On options in the AkEvent / AkAmbient is merely using the MonoBehaviour functions, like OnTriggerEnter() or Start(). So if those functions are working in a custom script, it should work for the integration as well. And Start() should definitely be called, as long as the game object you attach it to is enabled.

As for the Trigger Enter conditions, the same applies as above. AkTriggerEnter is simply using the OnTriggerEnter() function, so if you've got a Rigidbody + Trigger on it, it should work. I would definitely try to test this out in a custom script on the same game object.

Let us know if the functions in a custom script works.
Mads Maretty S. (Audiokinetic) (40.2k 포인트) 로 부터
Hi Mads and thank you for your message! Actually i wrote my message wrong the Ak Event Trigger on Start DO work ! Its only the Ak Trigger Enter that i just don't manage to make works even tho i have a capsule collider on the game object (Ellen) that is the player character we control, rigidbody on both and of course the option "Is Trigger" on the sphere cube i created to test my Trigger Enter sound! Do you know if i am missing something else ? Really weird as i have been doing it 1000 times on other 3D projects and that is the first time it's not working even tho everything sounds here...


Updated message: Actually went back in Unity, removed the Ak Event custom script and wrote the following script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test : MonoBehaviour
{

    [SerializeField] private AK.Wwise.Event MusicEvent;
    void OnTriggerEnter()
    {
        MusicEvent.Post(gameObject);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

==> Now the Box Trigger is working as i clearly here my music when the box is colliding with the ground but DOESN'T hear it anymore when i elevate my Box Trigger from the ground (to prevent the box trigger and ground to collide) which means the script is working BUT still can't make my Player Controler Game object triggers the script ! So it seems the problem is coming from the Player Character Game Object but it's weird as i have a rigidbody on it and the capsule collider is there too .

Do you know what could cause that Mads ? :) Thanks
Hmm. Regarding Capsule collider, there shouldn't be any differences between the type of collider. They all call OnTriggerEnter(). You could also write it like this...
https://www.audiokinetic.com/qa/8197/how-do-i-detect-which-sounds-are-entering-the-akenvironment?show=8197#q8197
About the script, it looks good, even though I would probably start by using prints.

IMO it still sounds like a problem with setting up trigger collider interactions. So I would probably...
(1) Start out testing two very simple triggers. Create a script like above with prints and test out your system.
(2) Once the above works, compare the "simple" setup with your player. Why is it that the above works, but specifically for the player it doesn't. Like check what components it has, maybe even check the collision matrix. Sometimes the best way to detect a problem, is to make it simple until it works and then scale it up again.

If you can't get (2) to work, then I would probably start reconstructing the player. Import it again, add the scripts / components, etc. to get a fresh start.
+1 투표

Hey Angel,

Alternatively, 

you may want to try changing the order of script execution 

by referring to the following documentation 

to ensure that AK-related scripts have a higher priority 

in the execution order list

Unity - Manual: Script Execution Order settings (unity3d.com)

Hou Chenzhong (Audiokinetic) (6.0k 포인트) 로 부터
hi Hou and thank you for your advice! Unfortunately it doesnt seem to be this causing the problem as i followed what you said by moving all Ak relatives script at the top of the list in the execution order but still doesn't make the Ak Event: Trigger On Trigger Enter works! As explained above on Mads comment it always has been working on Start and it works in Trigger Enter but NOT when its the character ! (it works when the cube collide the ground but not when i enter the cube collider with the player (which has a Capsule Collider and a a Ridibody attached)

If you have any other ideas its great!
Thanks in advance guys
Hey Angel, I've had the same problem while using the 3d game kit, where I couldn't get Ellen to trigger an AkEvent:Trigger on enter, and finally managed to make it work by changing the triggers layer to "environment". Not sure if this will help you, good luck.
Hi Kiran for your answer! Just to be sure what do you mean by "changing the trigger layer to environment" ? :)
Hey! I mean in the top right of the inspector window, under "layer".
Holy mother of God...I was researching for this problem for a whole week. I would never tought about the layer set. This is it man. Kiran B., you saved me! =D Thanks a lot!
Life saver! thxs a lot
Had a little problem using triggers also on the "3DGameKit" on Unity, just writing this down in case someone has the same issue : nothing would trigger even though I added the right TAG to Ellen (the character / listener) Or added a Rigidbody to her (which isn't on the character in the beginning and can cause problems when using the functions  - void ontrigger[...]) - the last problem that I found on this project while using triggers and that actually fixed the issue was on >> Edit - ProjectSettings - Physics - Scroll down and where there is the “Layer Collision Matrix”, on the first line: Default, look for the column “Player” and check the check box. And then the trigger functions should be working fine again. Hope this can help someone!
thanks a lot! Kiran B.
Same problem as Angel and now it works! Thanks a lot!
...