UActorComponent::SetComponentTickEnabledAsync
#include "Components/ActorComponent.h"
Access: public
Specifiers: virtual
Description
Spawns a game-thread task that calls SetComponentTickEnabled, allowing tick state changes to be queued from non-game threads without requiring a mutex.
Caveats & Gotchas
- • The change is not applied immediately — it is deferred to the game thread. Do not rely on IsComponentTickEnabled() returning the updated value in the same frame if called from a worker thread.
- • If you are already on the game thread, prefer calling SetComponentTickEnabled directly, which applies the change synchronously and avoids unnecessary task overhead.
Signature
ENGINE_API virtual void SetComponentTickEnabledAsync(bool bEnabled) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| bEnabled | bool | Whether the component tick should be enabled or disabled. | — |
Return Type
void Example
Disabling tick from a physics or background thread C++
// Called from a physics thread callback — cannot safely call SetComponentTickEnabled directly
void UMyComponent::OnPhysicsComplete()
{
// Queue the change for the game thread
SetComponentTickEnabledAsync(false);
} See Also
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?