I’m struggling here. In short, my particles are working correctly within the editor, but as soon as I press Play, the particles stop rendering. I just can’t figure out what I’m doing wrong.
I’ve created a blueprint from my base weapon class. The blueprint inherits the skeletal weapon mesh and the particle system component from the base class - both of these are UPROPERTY. I then set the mesh and the particle system in the blueprint. I drag the blueprint into the editor and the particles look exactly right - attached to the bone socket on the mesh. Life is good.
However, pressing play stops all the particles from spawning. I read something about making sure the particle system is using Local Space, but I don’t see this as an option for the ParticleSystemComponent Details. I have also experimented with muzzleFlashParticle->Activate() and tried different toggle settings with no success.
I’m looking for some guidance here and can provide whatever info you may need. Thanks in advance!
EDIT: I should note that in testing, I created an empty blueprint, added a ParticleSystemComponent, set the Template to the same particle system I’m using and added it to the level. It works in the editor and in the game with no issue. I sure this has something to do with my base class, but it’s as simple as it gets.
.h UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = RifleDetails) USkeletalMeshComponent* weaponMeshComponent; UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = RifleDetails) UParticleSystemComponent* muzzleFlashParticle;
.cpp // in constructor() muzzleFlashParticle = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("MuzzleFlashParticle")); muzzleFlashParticle->SetupAttachment(weaponMeshComponent, FName("Muzzle"));