Error C2027: use of undefined type 'UParticleSystemComponent'

Problematic code:

		UParticleSystemComponent* TrailPSC = UGameplayStatics::SpawnEmitterAtLocation(this, TrailFX, Origin);
			static FName Param = FName(TEXT("InitVelocity"));
			TrailPSC->SetVectorParameter(Param, AdjustVec);

I pretty much just copied what has been in ShooterExample, to test out idea for projectile trail for trace hit weapon.
In any case, I just run out of idea why it might not work. From what I see, it’s defined and initialized

Ahh well…

I just found answer. If anyone interesed:

Add to you header includes (the file that include Engine.h):

#include "ParticleDefinitions.h"

And it will work.

1 Like