UAudioComponent::GetAudioComponentID
#include "Components/AudioComponent.h"
Access: public
Specifiers: constinline
Description
Returns the unique instance ID assigned to this audio component, used internally to correlate it with active sounds on the audio render thread.
Caveats & Gotchas
- • This is a runtime-only handle, not a stable identifier — it is assigned from a global counter and is not the same as AudioComponentUserID, which is a serialized, designer-facing name.
- • The ID is only meaningful while the component exists; use it with GetAudioComponentFromID() to look the component back up from audio-thread callbacks where holding a raw UObject* would be unsafe.
Signature
uint64 GetAudioComponentID() const { return AudioComponentID; } Return Type
uint64 Example
Look up owning component from an audio-thread callback C++
uint64 ComponentID = AudioComponent->GetAudioComponentID();
// ... later, possibly on a different thread ...
if (UAudioComponent* Found = UAudioComponent::GetAudioComponentFromID(ComponentID))
{
// Safe to use Found on the game thread
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?