RealDocs

AActor::CheckComponentInstanceName

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public

Description

Checks for and resolves any name collisions before a new Blueprint-created component is instanced, renaming any existing component that conflicts with the given name.

Caveats & Gotchas

  • This modifies existing component names as a side effect if a conflict is found — the conflicting component is renamed, not the incoming one.
  • Called automatically during Blueprint component instancing; you only need to call it directly if you are implementing a custom component creation flow that mirrors the Blueprint construction pipeline.

Signature

ENGINE_API void CheckComponentInstanceName(const FName InName);

Parameters

Name Type Description Default
InName const FName The proposed name for the new component instance.

Return Type

void

Example

Validate name before creating a dynamic component C++
FName DesiredName = TEXT("MyCoolComponent");
CheckComponentInstanceName(DesiredName);
UMyComponent* NewComp = NewObject<UMyComponent>(this, DesiredName);
FinishAndRegisterComponent(NewComp);

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.