RealDocs

UActorComponent::NeedsLoadForClient

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

Description

Returns whether this component needs to be loaded on clients. Overrides the UObject default to account for the component's replication settings.

Caveats & Gotchas

  • Returns false when bIsEditorOnly is true, preventing editor-only components from being streamed to clients even if the owning actor is replicated.
  • If you override this in a subclass, ensure you also check the result of Super::NeedsLoadForClient() — returning true when the base returns false can cause unexpected data being sent to clients.

Signature

ENGINE_API virtual bool NeedsLoadForClient() const override

Return Type

bool

Example

Conditional client load override C++
bool UMyComponent::NeedsLoadForClient() const
{
	// Skip loading on clients if a custom flag is set
	if (bServerOnly)
	{
		return false;
	}
	return Super::NeedsLoadForClient();
}

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.