UActorComponent::IsAsyncCreatePhysicsStateRunning
#include "Components/ActorComponent.h"
Access: public
Specifiers: const
Description
Returns true if the component is currently in the process of asynchronously creating its physics state on a background scene.
Caveats & Gotchas
- • Do not access or modify the physics body while this returns true — the physics state is being constructed on a worker thread and is not safe to touch from the game thread.
- • This is only relevant for components that use async physics state creation (e.g. large static meshes in async scenes). Most components will always return false.
Signature
bool IsAsyncCreatePhysicsStateRunning() const Return Type
bool Example
Gate physics access until async creation completes C++
void UMyComponent::TryApplyImpulse(FVector Impulse)
{
if (!IsAsyncCreatePhysicsStateRunning())
{
// Safe to access body instance here
GetBodyInstance()->AddImpulse(Impulse, true);
}
} Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?