I have a beam particle system, and I want to spawn it from code. I think I understand the spawning process, but referencing it is not working so well. Here’s the relevant code:
UWaypointManager::UWaypointManager(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
static ConstructorHelpers::FObjectFinder<UParticleSystem> PSClass(TEXT("ParticleSystem'/Game/Waypoint/WPLine_PS.WPLine_PS'"));
if (PSClass.Object != NULL)
MyParticleSystem = PSClass.Object; // MyParticleSystem is a UParticleSystem pointer
}
I’m getting the error
Error 1 error C2664: 'void ConstructorHelpers::ValidateObject(UObject *,const FString &,const TCHAR *)' : cannot convert argument 1 from 'UParticleSystem *' to 'UObject *' C:\GitHub\UnrealEngine\Engine\Source\Runtime\CoreUObject\Public\UObject\ConstructorHelpers.h 71 1 AssassinGame
I’ve also tried referencing the particle system as a UObject and casting to UParticleSystem, but no luck. I’m stuck, any ideas? Thanks!