RealDocs

UActorComponent::GetUCSSerializationIndex

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

Description

Returns the index used to identify this component's position in the User Construction Script serialization stream. Primarily used by the editor to correlate serialized component data with the UCS output.

Caveats & Gotchas

  • This can be an expensive operation in the editor when the component was saved before UCS serialization index tracking was introduced — in that case the index is computed on-demand.
  • This value is meaningless at runtime outside of editor builds; the WITH_EDITORONLY_DATA guard means the cached value is not present in cooked builds.
  • Game code should never depend on this value — it is an editor serialization implementation detail.

Signature

int32 GetUCSSerializationIndex() const

Return Type

int32

Example

Log UCS serialization index for debugging in editor C++
#if WITH_EDITOR
void UMyComponent::DebugPrintUCSIndex() const
{
	UE_LOG(LogTemp, Log, TEXT("UCS serialization index: %d"), GetUCSSerializationIndex());
}
#endif

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.