Can't set particle parameter, works only in begin play event

Hello,

Im setting particle parameter in projectile but cant get it working, it works only in begin play event… Any advices?
(I found second solution, setting material instance which works well perfectly on projectile stop, but im interested in this why this does not work…)

Hi Name368,

I was able to get this working just fine on my end. It depends on how you are referencing the particle system. I had the particle system as a component of the projectile blueprint and created a reference to that (see screenshot).

Also if you create a particle component variable type and set its default value to the particle system this won’t work. Just to be sure, are you setting the color and opacity inputs in your material to particle color? (see second screenshot for example)

Hello, for reply. Yes im setting color and opacity inputs with particle color node. Here is my BP extended, i hope this help :slight_smile:

As you can see, one node works, second not, i dont have idea why not, the most strange part is that i found it working only in begin play event without delay node…

I’m having issues reproducing your issue. Here are the steps I took:

  1. Create a new FPS Blueprint project
  2. Add a new particle system and a material
  3. Open the material and set it to translucent blend mode
  4. Create a particle color node and plug the color output into Emissive Color
  5. Plug the alpha output into opacity and compile then close
  6. Open the particle system and apply the material in the required module
  7. Click on Color Over Life module and change the alpha distribution to “Distribution Float Particle Parameter” and name it “Opacity” >** also set the constant value to 1**
  8. Open FirstPersonProjectile and add a particle system component> assign the one you just made
  9. Create a reference to the particle system (in even graph) > drag off then create a Set Float Parameter node and change parameter name to “Opacity” and keep the value at 0
  10. Create an On Projectile Stop node and plug it into the Set Float Parameter
  11. Also turn off should bounce
  12. Play in Editor

Result The particle sprites that follow the projectile disappear when the projectile stops.

Note Setting the constant value is important so the particle is visible by default and it’s an easy step to miss which is why I put it in bold font.

If you can reproduce the issue with the steps I provided please let me know if not then it may be an issue with your assets or their implementation along the line.

Thank you for your time,

I ran into a similar issue in my game: I could change the parameters in the BeginPlay() of my actor/component, but if I change them later, it would not change the visual of my ParticleSystem. In case anyone has a similar issue, my solution was to simply deactivate the system, set the parameter and activate it again. In C++, it looks like this:

    UParticleSystemComponent* pParticleSystemComp = Cast<UParticleSystemComponent>(mpCharacter->GetDefaultSubobjectByName(TEXT("MyCircleComponent")));
    if (pParticleSystemComp)
    {
        FVector vectorParam(1.0f, 0.5f, 0.0f);
        pParticleSystemComp->Deactivate();
        pParticleSystemComp->SetVectorParameter(TEXT("VectorParameterName"), vectorParam);
        pParticleSystemComp->Activate();
    }

I hope it helps!