UParticleSystemComponent to UParticleSystem

The UParticleSystem is loaded from content. The ParticleSystemComponent (assuming you are attaching to an actor) is what is spawned at run time. Example:

In the .h file:



// particle system definition
UPROPERTY(EditInstanceOnly)
UParticleSystem* _effectFx = nullptr;

// particle system component spawned at runtime
UPROPERTY(EditInstanceOnly)
UParticleSystemComponent* _effectFxComponent = nullptr;

In the .cpp file:



// load particle system
FString particleEffectPath = "/Game/ParticleEffects/Fire/ElectricFires/ElectricFire";
_effectFx = Cast<UParticleSystem>(StaticLoadObject(UParticleSystem::StaticClass(), NULL, *particleEffectPath));

// play effect
_effectFxComponent = UGameplayStatics::SpawnEmitterAttached(_effectFx,
RootComponent,
NAME_None,
FVector::ZeroVector,
FRotator::ZeroRotator,
EAttachLocation::SnapToTarget,
false);