C++ Attaching Components

This contructor works, there is one condition. You particle system has to work in local space
localSpace

AMainActor::AMainActor()
{

	PrimaryActorTick.bCanEverTick = false;

	BlinkParticleSystem = CreateDefaultSubobject<UNiagaraComponent>(TEXT("Blink Particle System"));
	BlinkParticleSystem->SetMobility(EComponentMobility::Movable);
	SetRootComponent(BlinkParticleSystem);
		
	ClimbIndicator = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Climb Indicator"));		
	ClimbIndicator->SetupAttachment(BlinkParticleSystem);		
		
}


1 Like