UAudioComponent::OnUpdateTransform
#include "Components/AudioComponent.h"
Access: public
Specifiers: virtualoverride
Description
Called by the engine whenever this component's world transform changes, allowing the audio component to update the position of any active sound.
Caveats & Gotchas
- • This is a SceneComponent internal hook, not something to call directly — moving the component (e.g. via SetWorldLocation) triggers it automatically.
- • Frequent transform updates (e.g. every tick on a fast-moving actor) each invoke this, so avoid unnecessary manual transform churn on audio components with expensive attached sounds.
Signature
ENGINE_API virtual void OnUpdateTransform(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport = ETeleportType::None) override; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| UpdateTransformFlags | EUpdateTransformFlags | Flags describing how the transform update was propagated (e.g. skip physics update). | — |
| Teleport | ETeleportType | Whether the move should be treated as a teleport for physics/interpolation purposes. | ETeleportType::None |
Return Type
void Example
Override to react to transform changes C++
void UMyAudioComponent::OnUpdateTransform(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport)
{
Super::OnUpdateTransform(UpdateTransformFlags, Teleport);
// React to the new world transform here
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?