# Niagara Map For Not Working Correctly and How to do array add in niagara's custom hlsl, I didn't find any hlsl function for it.

**URL:** <https://forums.unrealengine.com/t/niagara-map-for-not-working-correctly-and-how-to-do-array-add-in-niagaras-custom-hlsl-i-didnt-find-any-hlsl-function-for-it/1902503>\
**Category:** FX\
**Tags:** development, effect, unreal-engine, hlsl, question\
**Created:** [June 14, 2024, 2:25am UTC](https://forums.unrealengine.com/t/niagara-map-for-not-working-correctly-and-how-to-do-array-add-in-niagaras-custom-hlsl-i-didnt-find-any-hlsl-function-for-it/1902503 "2024-06-14T02:25:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Sakuya\_Saki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sakuya_saki/32/624962_2.png) [@Sakuya\_Saki](https://forums.unrealengine.com/u/Sakuya_Saki)\
**Post date:** [June 14, 2024, 2:30am UTC](https://forums.unrealengine.com/t/niagara-map-for-not-working-correctly-and-how-to-do-array-add-in-niagaras-custom-hlsl-i-didnt-find-any-hlsl-function-for-it/1902503/2 "2024-06-14T02:30:37Z")

</div>

additional information

Niagara doesn’t report any error, but it’s just that my function isn’t working correctly. Theoretically, he should be giving me an array, but I’m checking later to see if it’s 0 or 1. I can’t quite remember. Anyway, map for shouldn’t be working correctly.

I’ve referenced this, but it doesn’t work.

> [@Niagara "Map For" Can't Set Array Elements](https://forums.unrealengine.com/t/niagara-map-for-cant-set-array-elements/769879/2):
>
> Hey, couple of things: You just have to connect the set array call to the map for node, e.g. by setting a dummy value (see below) You don’t have to calculate the current interation yourself, there is a node for it already You can always just pop down a custom hlsl node and write the for loop yourself. You can get the hlsl version of the data interface functions by right-clicking on the data interface pin and then go to “Data Interface Function HLSL…”

---

_[View the full topic](https://forums.unrealengine.com/t/niagara-map-for-not-working-correctly-and-how-to-do-array-add-in-niagaras-custom-hlsl-i-didnt-find-any-hlsl-function-for-it/1902503)._
