# C++ Set Niagara Variable Color array

**URL:** <https://forums.unrealengine.com/t/c-set-niagara-variable-color-array/669649>\
**Category:** C++\
**Tags:** variables, Data-Types, unreal-engine, Scripting, question\
**Created:** [October 14, 2022, 7:07pm UTC](https://forums.unrealengine.com/t/c-set-niagara-variable-color-array/669649 "2022-10-14T19:07:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anti-Wisdom](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/anti-wisdom/32/575220_2.png) [@Anti-Wisdom](https://forums.unrealengine.com/u/Anti-Wisdom)\
**Post date:** [October 14, 2022, 7:07pm UTC](https://forums.unrealengine.com/t/c-set-niagara-variable-color-array/669649/1 "2022-10-14T19:07:38Z")

</div>

I created a Particle system using Niagara and this system has different dynamic user parameters. I know how to change these parameters at runtime using say: UNiagaraComponent-\>SetNiagaraVariableFloat(),  
but the variable I have to change now is a Color Array.  
 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/a/07a5e05d2b4d74fc444becbd2f68cf0e848c7997.png)  
How do I go about changing this variable at runtime given that the available methods don’t seem to cover editing this type?  
I get the sense I am missing something very obvious.

---

<div class="post-metadata">

**Author:** ![Anti-Wisdom](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/anti-wisdom/32/575220_2.png) [@Anti-Wisdom](https://forums.unrealengine.com/u/Anti-Wisdom)\
**Post date:** [October 14, 2022, 7:46pm UTC](https://forums.unrealengine.com/t/c-set-niagara-variable-color-array/669649/2 "2022-10-14T19:46:17Z")

</div>

Figured it out, the method to set a Color Array parameter in Niagara (along with a whole bunch of other data types) can be done through

UNiagaraDataInterfaceArrayFunctionLibrary

I just needed to use method:

UNiagaraDataInterfaceArrayFunctionLibrary::SetNiagaraArrayColor(UNiagaraComponent\* NiagaraSystem, FName OverrideName, const TArray& ArrayData)

The particle system works now.
