UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PawnNoiseEmitterComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4
5#pragma once
6
7#include "CoreMinimal.h"
10#include "PawnNoiseEmitterComponent.generated.h"
11
12class AActor;
13
18UCLASS(ClassGroup=AI, meta=(BlueprintSpawnableComponent), MinimalAPI)
20{
22
23protected:
24 // If set to true (default value) will notify AIPerceptionSystem about noise events
25 // otherwise only PawnSensingComponents will be able to pick up noises generated by this component
26 UPROPERTY(EditDefaultsOnly, Category = "AI Perception", AdvancedDisplay)
27 uint32 bAIPerceptionSystemCompatibilityMode : 1;
28
29public:
30 // Most recent noise made by this pawn not at its own location
31 UPROPERTY()
32 FVector LastRemoteNoisePosition;
33
34 // After this amount of time, new sound events will overwrite previous sounds even if they are not louder (allows old sounds to decay)
35 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Noise Settings")
36 float NoiseLifetime;
37
43 UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="Audio|Components|PawnNoiseEmitter")
44 ENGINE_API virtual void MakeNoise(AActor* NoiseMaker, float Loudness, const FVector& NoiseLocation);
45
46 ENGINE_API float GetLastNoiseVolume(bool bSourceWithinNoiseEmitter) const;
47 ENGINE_API float GetLastNoiseTime(bool bSourceWithinNoiseEmitter) const;
48
50 // Most recent volume of noise made by this pawn not at its own location
51 UPROPERTY()
52 float LastRemoteNoiseVolume;
53
54 // Time of last remote noise update
55 UPROPERTY()
56 float LastRemoteNoiseTime;
57
58 // Most recent noise made by this pawn at its own location
59 UPROPERTY()
60 float LastLocalNoiseVolume;
61
62 // Time of last local noise update
63 UPROPERTY()
64 float LastLocalNoiseTime;
65};
66
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Actor.h:257
ENGINE_API void MakeNoise(float Loudness=1.f, APawn *NoiseInstigator=nullptr, FVector NoiseLocation=FVector::ZeroVector, float MaxRange=0.f, FName Tag=NAME_None)
Definition Actor.cpp:3358
FName Tag const
Definition Actor.h:3810
Definition ActorComponent.h:152
Definition PawnNoiseEmitterComponent.h:20
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53