Hi everyone,
I’ve been experiencing persistent crashes when entering PIE while using the Water plugin in UE 5.7 (specifically the Shallow Water River features).
After digging into the logs, I found that the root cause is a shader compilation error inside the Grid2D_SW_River Niagara system, which prevents the simulation data from being generated properly.
Here is the exact error log:
warning: redefinition of 'i' shadows declaration in the outer scope
It turns out there is a variable shadowing issue inside a Custom HLSL script within the SW_River_Secondary_Emitter, where the loop variable int i is declared twice in the same scope.
To fix this, I looked into two potential solutions:
1. Disabling the problematic emitter altogether I simply unchecked and disabled the SW_River_Secondary_Emitter (which seems to handle secondary details like foam). After doing this, the system compiled successfully, and the crashes completely stopped!
2. Modifying the HLSL code directly Going into the Custom HLSL node and manually changing the inner loop variable from i to j (e.g., for(int j = 0; ...)).
My Question: I am currently using the first method (disabling the emitter) as a quick fix to prevent crashes. Is it safe to just leave this secondary emitter disabled, or will it cause other underlying issues with the Water system’s stability? Would it be better practice to manually edit the engine plugin code (Method 2), or is there a more official workaround for this bug?
Any advice or insights would be greatly appreciated!
Thanks!