Hello. I am a student studying in South Korea.
I came here because I was curious while writing the Niagara module script.
There are ‘select’ and ‘if’ nodes, but the execution itself cannot be skipped and only values are given differently depending on the condition.
All I want is to pre-terminate logic, like ‘return;’ in ‘C++ programming’.
What I’m trying to do:
When the lengths of the two vectors are zero, they terminate without executing the subsequent logic.
I’m pretty sure there are no true conditional statements in Niagara. The modules you’re building using nodes are actually using HLSL, which as far as I know it’s not a friend of conditional operators.
Much like when working on shaders or materials, you could store the initial value for whichever parameters you’re changing, and whenever the condition you want is false, just pin those defaults to the result. Here’s an example:
This module checks if MyValue is greater than 5, and if that’s the case multiplies the position by 2. If that’s not the case it changes nothing.
Not sure if there’s another way to do it…
Then, I think we should keep the existing value and hand it over to the printout after handling the exception.
Thank you for your kind reply!