# Using Particle System Instance Parameters in C++

**URL:** <https://forums.unrealengine.com/t/using-particle-system-instance-parameters-in-c/298707>\
**Category:** FX\
**Tags:** unreal-engine, particle, question, CPP\
**Created:** [November 11, 2014, 4:02am UTC](https://forums.unrealengine.com/t/using-particle-system-instance-parameters-in-c/298707 "2014-11-11T04:02:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyperdr1ve](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hyperdr1ve](https://forums.unrealengine.com/u/hyperdr1ve)\
**Post date:** [November 11, 2014, 4:02am UTC](https://forums.unrealengine.com/t/using-particle-system-instance-parameters-in-c/298707/1 "2014-11-11T04:02:28Z")

</div>

I am having difficulty correctly setting particle system instance parameters in C++. It seems that my actors are not getting set correctly.

I’m trying to convert the beam tutorial to C++. The only step that’s tripping me up is setting the “BeamSource” and “BeamTarget” instance parameters via code. _Note: I can drag my particle system into a level and hook up the source/destination and it works **as expected**._

I’m calling this on my particle emitter:

```
for (UParticleSystemComponent* emitter : particles)
{
    emitter->SetActorParameter(TEXT("BeamSource"), previousSegment);
    emitter->SetActorParameter(TEXT("BeamTarget"), segment);
}

```

Where previousSegment and segment are the source and target AActor’s in my scene.

I can then set a breakpoint and look at `emitter->InstanceParameters` and confirm that the `Actor` field is no longer a NULL pointer. But if I then go into the particle settings and turn up my source distribution vector constant, I see my particle system change, despite its source method being **Actor**.
