RealDocs

UActorComponent::UnregisterComponent

function Engine Since 4.0
#include "Components/ActorComponent.h"
Access: public

Description

Unregisters this component from the world, destroying its rendering and physics state, but does not mark it for garbage collection. The component can be re-registered later.

Caveats & Gotchas

  • Does not destroy the component object — use DestroyComponent for that. Unregistering only tears down the render/physics state, leaving the UObject alive.
  • Unregistering a component mid-tick can cause stalls if the render thread is currently processing it; prefer deferring registration changes to after the tick group completes.

Signature

ENGINE_API void UnregisterComponent()

Return Type

void

Example

Temporarily disabling a component by unregistering it C++
// Tear down render/physics state without destroying the component
MyComponent->UnregisterComponent();
// ... do work ...
// Bring it back
MyComponent->RegisterComponent();

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.