ULimenStepsSoundComponent
Overview
ULimenStepsSoundComponent is an audio component that plays step sounds based on the character's velocity and the surface it's moving on. It integrates with AI perception to register audio events, enhancing the realism of locomotion in games.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| SoundSettingsList | EditDefaultsOnly | A list of sound settings for different physical materials. |
| bPlayIn3dSpace : 1 | EditDefaultsOnly | Determines whether to play audio in the 3D world's space or ignore spatial audio. |
| LineTraceCollisionChannel | EditDefaultsOnly | The collision channel used for line tracing to determine the physical material under the character. |
| LineTraceTolerance | EditDefaultsOnly | Tolerance value for line trace calculations. |
| StepsSoundDelayBySpeed | EditDefaultsOnly | A map of velocity thresholds and corresponding sound delays and volume levels. |
| MinimumSilentSpeed | EditDefaultsOnly | The minimum speed at which audio events are registered with the AI system. |
Functions
Return Type | Signature | Description |
|---|---|---|
| BeginPlay() | Initializes the component, sets up collision parameters, and retrieves necessary components. |
| TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) | Updates the audio settings based on the character's velocity and physical material. |
| PlayStepAudio() | Plays the step sound and registers an AI event if the character is moving at a sufficient speed. |
| GetStepPhysicalMaterial() const | Determines the physical material under the character using line tracing. |
| GetStepAudioDelayAndVolumeLevelForVelocity(const double Velocity) const | Interpolates between predefined sound delays and volume levels based on the character's velocity. |
| GetStepSoundToPlay(const UPhysicalMaterial* PhysicalMaterial) | Selects the appropriate step sound based on the physical material under the character. |
Usage & Implementation Notes
Threading Constraints: This component should be ticked on the game thread.
Replication Requirements: None.
Memory Lifetime Management: The component manages its own memory for audio data and settings.
Initialization Dependencies: Depends on
UPawnMovementComponentandUAIPerceptionSystem.