# Niagara: error when using an expression

**URL:** <https://forums.unrealengine.com/t/niagara-error-when-using-an-expression/469721>\
**Category:** FX\
**Tags:** unreal-engine, question\
**Created:** [August 14, 2020, 12:23am UTC](https://forums.unrealengine.com/t/niagara-error-when-using-an-expression/469721 "2020-08-14T00:23:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msharpe96](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@msharpe96](https://forums.unrealengine.com/u/msharpe96)\
**Post date:** [August 14, 2020, 12:23am UTC](https://forums.unrealengine.com/t/niagara-error-when-using-an-expression/469721/1 "2020-08-14T00:23:42Z")

</div>

In Niagara I’m trying to use an expression in an Add Velocity module to check if a vector is not equal to 0 and based on that set the Add Velocity module’s value to another User variable, but I keep getting this error and I’m not sure what it means:

The Vector VM compile failed. Errors:  
/Plugin/FX/Niagara/Private/NiagaraEmitterInstanceShader.usf(0): error: Component x of variable branch\_flatten\_temp has no valid offset. Possibly uninitialized data being used.  
/Plugin/FX/Niagara/Private/NiagaraEmitterInstanceShader.usf(0): error: Component x of variable branch\_flatten\_temp has no valid offset. Possibly uninitialized data being used.  
/Plugin/FX/Niagara/Private/NiagaraEmitterInstanceShader.usf(0): error: Component y of variable branch\_flatten\_temp has no valid offset. Possibly uninitialized data being used.  
/Plugin/FX/Niagara/Private/NiagaraEmitterInstanceShader.usf(0): error: Component y of variable branch\_flatten\_temp has no valid offset. Possibly uninitialized data being used.

Here’s the expression I’m trying to use in the Add Velocity module: User.SmokeVelocityScale != float3(0,0,0) ? User.MaxWindVelocity : User.MaxVelocity

The variable User.SmokeVelocityScale gets set in code based on a value the user enters in a previous level, so when the new level begins if User.SmokeVelocityScale is not 0 set my velocity to User.MaxWindVelocity, otherwise set it to User.MaxVelocity. Any suggestions to fix the error is appreciated!

---

<div class="post-metadata">

**Author:** ![WildFire98](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WildFire98](https://forums.unrealengine.com/u/WildFire98)\
**Post date:** [February 8, 2022, 10:03am UTC](https://forums.unrealengine.com/t/niagara-error-when-using-an-expression/469721/2 "2022-02-08T10:03:19Z")

</div>

I meet same problm when i was trying to rebuild the first example in the Advanced Niagara Map which belongs to Example Content.
