# Niagara Function Call not allowed for this stack context

**URL:** <https://forums.unrealengine.com/t/niagara-function-call-not-allowed-for-this-stack-context/488549>\
**Category:** FX\
**Tags:** unreal-engine, question\
**Created:** [September 8, 2021, 4:42pm UTC](https://forums.unrealengine.com/t/niagara-function-call-not-allowed-for-this-stack-context/488549 "2021-09-08T16:42:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Solidus569](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Solidus569](https://forums.unrealengine.com/u/Solidus569)\
**Post date:** [September 8, 2021, 4:42pm UTC](https://forums.unrealengine.com/t/niagara-function-call-not-allowed-for-this-stack-context/488549/1 "2021-09-08T16:42:11Z")

</div>

I am trying to resize a bool array data interface when the emitter starts up. As shown in the picture below I have the flags for the module set to only be usable in the emitter spawn context. However, when compiling I get the error as shown, which seemingly says that this isn’t a valid stack context.

 ![348257-flags.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/0/5e086fe29442bf1924c2adaac8365e6436f8086a.png)

Is there a difference between the bitmask flags and actual stack context? If THAT is the case, how do I properly set the stack context for this module?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![mixer76](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mixer76](https://forums.unrealengine.com/u/mixer76)\
**Post date:** [January 4, 2023, 2:38am UTC](https://forums.unrealengine.com/t/niagara-function-call-not-allowed-for-this-stack-context/488549/2 "2023-01-04T02:38:41Z")

</div>

Hello, have you found a solution to this? Thank you!

---

<div class="post-metadata">

**Author:** ![NielsDewitte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nielsdewitte/32/606994_2.png) [@NielsDewitte](https://forums.unrealengine.com/u/NielsDewitte)\
**Post date:** [January 4, 2023, 5:18am UTC](https://forums.unrealengine.com/t/niagara-function-call-not-allowed-for-this-stack-context/488549/3 "2023-01-04T05:18:54Z")

</div>

Looks and smells like a bug.  
Maybe try again with newer version of the engine, and if it doesn’t work, send a bug report.

---

<div class="post-metadata">

**Author:** ![ifurkend](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ifurkend](https://forums.unrealengine.com/u/ifurkend)\
**Post date:** [April 20, 2024, 8:59am UTC](https://forums.unrealengine.com/t/niagara-function-call-not-allowed-for-this-stack-context/488549/4 "2024-04-20T08:59:55Z")

</div>

Tested in 5.4 and this is still not fixed.  
Utilizing array in Niagara script is next to impossible.  
Adding array element only works properly in GPU simulation.  
In CPU sim, only the first element is written no matter the array size or iterations.  
This also means it’s not possible to be done in System/Emitter stack.
