Reading Array in Niagara Custom HLSL

Thanks. I got this to work, somehow. When I do this in a scratch pad and set the scratch module in a GPU emitter. However, when I am using it in a CPU emitter or making it a standalone module script asset, the compiler gives me the lvalue (???) error.

I know I can just use the #if GPU_SIMULATION condition, but I am so baffled because the array function nodes work in both CPU and GPU simulations, but not the array commands and loops in custom HLSL? I just don’t understand.
image

Anyway, thanks for the great help. Also I realized that there is a handy list of array commands with in/out explanations if I copy them to the notepad.
image

2 Likes