How to use UserParameter in Niagara HLSL Expression

I would really like to use my user parameter in a custom hlsl expression for my niagara system
I see how to use Emitter parameters by just doing Emitter.Param, but User.Param doesn’t work.

Also in general wondering if there is another way to convert a user param float into a vector that only has the float in the X position (as this is what i’m trying to do)

My hlsl looks like this:

float3(User.LengthParam, 0.f, 0.f)

1 Like

I’m trying to reference a user parameter in a custom HLSL expression in Niagara.
Did you resolve this/have an answer?

The OP seems to have been on the right track. The main important thing is to use the User.YourUserVariable syntax. Although the compilation errors can be pretty obscure. I just spent a bunch of time figuring out that User.MyVector.x is the right way to get a component of a vector rather than User.MyVector.X which gave an obscure compile error. :person_facepalming:

3 Likes