RealDocs

AActor::MakeNoiseImpl

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: static

Description

Default static implementation called by the MakeNoise delegate. Routes a noise event to the AI perception system. Override the delegate via SetMakeNoiseDelegate to replace this with a custom implementation.

Caveats & Gotchas

  • Do not call this function directly — call the instance method MakeNoise() instead, which routes through the MakeNoiseDelegate. This static function is the default target of that delegate and can be replaced without subclassing.
  • This only works with AIPerception's Hearing sense (UAISense_Hearing). The legacy PawnSensingComponent has its own noise path and does not respect MaxRange set here.

Signature

static ENGINE_API void MakeNoiseImpl(AActor* NoiseMaker, float Loudness, APawn* NoiseInstigator, const FVector& NoiseLocation, float MaxRange, FName Tag)

Parameters

Name Type Description Default
NoiseMaker AActor* The actor producing the noise.
Loudness float Relative loudness of the noise, used to scale detection range.
NoiseInstigator APawn* The pawn responsible for making the noise, used by AI perception.
NoiseLocation const FVector& World-space position of the noise. Zero vector uses the actor's location.
MaxRange float Maximum range at which the noise can be heard. 0 means unlimited range (capped by perception settings).
Tag FName Identifier for the noise type, used by AI filters.

Return Type

void

Example

Replace noise delegate with a custom implementation C++
// In game module startup
AActor::SetMakeNoiseDelegate(FMakeNoiseDelegate::CreateStatic(&UMyAISubsystem::HandleNoise));

// Then actors calling MakeNoise() will route to your function instead

Tags

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.