UActorComponent::IsReplicatedSubObjectRegistered
#include "Components/ActorComponent.h"
Access: public
Specifiers: const
Description
Returns true if the given subobject is currently registered in this component's replicated subobject list. Useful to avoid double-registering the same object.
Caveats & Gotchas
- • This checks the component's local registered list only — it does not verify whether the subobject has actually been sent to any client or whether any active channel knows about it.
- • Passing nullptr always returns false without asserting; it is safe to use as a null guard before AddReplicatedSubObject.
Signature
ENGINE_API bool IsReplicatedSubObjectRegistered(const UObject* SubObject) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SubObject | const UObject* | The subobject to check registration status for. | — |
Return Type
bool Example
Prevent double-registration C++
void UMyComponent::EnsureSubObjectReplicated(UObject* SubObj)
{
if (SubObj && !IsReplicatedSubObjectRegistered(SubObj))
{
AddReplicatedSubObject(SubObj);
}
} Tags
Version History
Introduced in: 5.1
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?