New component not appearing in actor details

You need to call AddInstanceComponent on your actor so it becomes aware of the new component.

UPrimitiveComponent* ATargetFinder::CreateSphereVolume(const FTargetFinderFactoryStruct& data)
{
	USphereComponent* newSphere = NewObject<USphereComponent>(this, TEXT("DebugSphere1"));
	newSphere->RegisterComponent();

	newSphere->AttachToComponent(this->RootComponent, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false));

	// IMPORTANT.  Ensures the actor knows about the component and it is visible in the details panel.
	this->AddInstanceComponent(newSphere);

  // Do whatever else here...
3 Likes