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.

Unreal: AnimNotify_AKEvent Complains There is No AkComponent In Automated Tests

+4 votes
The following warnings appear in our logs when running automated tests. They happen because developers are creating test characters and don't add the AK component.

LogBlueprintUserMessages: [AnimNotify_AkEvent_C_3] WARNING: AkComponent has been created in the notify. It will be using default values for all properties.
LogBlueprintUserMessages: [AnimNotify_AkEvent_C_3] WARNING: Should you wish to use different values, please attach an AkComponent to the Test_AI_Character_C_3.CharacterMesh0 SK_Wolf component on the Test_AI_Character3 actor beforehand.

I've added the AK Component with the proper socket after the fact, but the AnimNotify_AkEvent is still complaining. I'm not sure why this is the case.

Should these warnings even be warnings or are they more of an information? Is it bad that the AnimNotify has to create the AKComponent, if not my current plan is to downgrade these from a warning to an info? It only does it on initialization of the character mesh. It seems like wasted time to go and add the AK Components just for automated tests, when the audio doesn't matter for those specific tests.
asked Nov 4, 2019 in General Discussion by Megan S. (460 points)
retagged Nov 4, 2019 by Megan S.
I have the exact same issue. How to disable those warnings?
Was there ever an answer to this? I'm getting the same thing and have no idea how to fix it!
The warnings also dissapear when you untick "Follow" in the AnimNoitfy Settings...
Still occurring in UE5 and 2022 beta.

4 Answers

0 votes

也许是因为你所添加的AK组件中的某处编写错误了,检查一下你的代码/蓝图是否完全编写正确吧。

或者,请留意输出日志中是否存在其他可疑的报错。

Translation:
Maybe it's because some part of the AK component you added was written incorrectly. Check if your code/blueprint is completely written correctly.

Or, please pay attention to whether there are other suspicious errors in the output log.
answered May 8, 2020 by 刘乃豪 (140 points)
edited Sep 29, 2021 by Bernard R. (Audiokinetic)
0 votes

Workaround : Right-Click on the AkEvent notify on your animation ---> Open Notify Blueprint ---> Delete the exec node going into print string (works 100%)

I was having this error for ages, couldn't figure out why! Apparently, if I uncheck the follow button on the details tab of the notify the error stops - but then it posts event at location instead of mesh which is a bummer. If you look through carefully in the blueprint there is a 'Print String' node for the true condition of 'Follow' and then it posts the print string of the error. I haven't solved how to actually stop the error. But the workaround just works fine. I just ended up deleting the exec node to print string and error has stopped. The sounds work fine so I don't care - although I'd be interested in knowing what the actual issue is and if Audiokinetic is addressing it in future updates!

From the true exec node of Branch after Get AK Component, going into the Print String - just delete it! 

 

answered Sep 20, 2021 by Chirag M. (260 points)
Thank you so much! I've been trying to find a workaround for so long for this, and you've finally figured it out - so simple too. As you say, I'm keen to see what the actual problem is and if Audiokinetic is able to do anything about it, but this is such a welcome workaround. Thanks again!
0 votes
Maybe the RelativeLocation of AKComponent was not (0,0,0). there is a check like this 'if ( !FVector::PointsAreSame(*Location, RelLoc) continue;' in FAkAudioDevice::GetAkComponent.
answered Aug 11, 2022 by KoKuu (140 points)
0 votes

I also investigated this issue today using Unreal 5.3 and Wwise 2023.1.1.8417, it still exists and is a problem on the code side from AudioKinetic in the respective Unreal plugin.
First and foremost: Deleting log prints is never a solution @Chirag M.! 

Let's get to the solution.

Setup:

  • A Character blueprint with one or multiple AkComponents that are bound to sockets of the mesh
  • An animation (sequence) that includes one or many AnimNotify_AkEvent which have their "Attach Name" property set to the socket names where the wanted AkComponent is bound to

Issue:

  • The AkComponent can not be found when running the animation and a new AkComponent is created by the system on which the AkEvent is then posted

Reason:

  • Open the AnimNotify_AkEvent blueprint and check out the "GetAkComponent" function. This function calls the C++ function of AkGameplayStatics::GetAkComponent with a standard location of (0,0,0)
  • The AkGameplayStatics::GetAkComponent function passes this location, which never is null, as a reference to the AkAudioDevice->GetAkComponent(..., &Location, ...). This is a huge error, as that function actually takes a pointer to an FVector and intends for this pointer to also be a nullptr sometimes. However, AkGameplayStatics::GetAkComponent always enters a valid FVector. 
AkAudioDevice::GetAkComponent:
...
// If a location is requested, try to match location.
if ( Location )
{
    if (LocationType == EAttachLocation::KeepWorldPosition)
    {
       AttachRules = FAttachmentTransformRules::KeepWorldTransform;
       if ( !FVector::PointsAreSame(*Location, pCompI->GetComponentLocation()) )
          continue;
    }
    else
    {
       AttachRules = FAttachmentTransformRules::KeepRelativeTransform;
       auto RelLoc = pCompI->GetRelativeLocation();
       if ( !FVector::PointsAreSame(*Location, RelLoc) )
          continue;
    }
}
  • Location here will thus never be a nullptr and you always run into a comparison in the end, if your location (in our case (0,0,0)) matches the location of your AkComponent pCompI->GetRelativeLocation() as @KoKuu has correctly pointed out.
  • If our AkComponent on the Character does not sit at (0,0,0), which is very likely for footstep components or other stuff, the code will just continue and not choose that component.

Solution:

  • Don't ever use AkGameplayStatics::GetAkComponent.
  • Let your programmers copy the code from the function and make a helper function that can call AkAudioDevice::GetComponent also with a nullptr for the location
  • In the AnimNotify_AkEvent blueprint, replace the call to AkGameplayStatics::GetAkComponent with your helper function

I have filed a bug report for this, let's see if something happens.

Cheers

answered Mar 26 by Maximilian Mayer (150 points)
...