AActor::IsActorComponentReplicatedSubObjectRegistered
#include "GameFramework/Actor.h"
Access: public
Specifiers: const
Description
Returns true if the given object is currently registered as a replicated sub-object of the specified actor component.
Caveats & Gotchas
- • Both the component and sub-object pointers must match exactly what was passed to AddActorComponentReplicatedSubObject. If either differs (even if logically the same object), this returns false.
- • Returns false for sub-objects registered directly on the actor via AddReplicatedSubObject — use IsReplicatedSubObjectRegistered for those.
- • A return value of true means the sub-object is in the registry, not that it has been replicated to any specific client yet.
Signature
ENGINE_API bool IsActorComponentReplicatedSubObjectRegistered(const UActorComponent* OwnerComponent, const UObject* SubObject) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| OwnerComponent | const UActorComponent* | The component that is expected to own the sub-object. | — |
| SubObject | const UObject* | The sub-object to check for registration under the given component. | — |
Return Type
bool Example
Conditional removal guard C++
void AMyActor::OnComponentSubObjectExpired(UActorComponent* Comp, UObject* SubObj)
{
if (IsActorComponentReplicatedSubObjectRegistered(Comp, SubObj))
{
RemoveActorComponentReplicatedSubObject(Comp, SubObj);
}
} See Also
Tags
Version History
Introduced in: 5.1
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?