There have been some changes to the NeighborGrid3D from UE4 to UE5. It is a more flexible system now, but requires a little bit of work in order to utilize.
https://dev.epicgames.com/community/learning/tutorials/7xdb/neighborgrid3d-changes-in-ue5-0
When I go into the “NeighborGrid3D_SetResolution” Script.
There is an error stating "Function call “SetNumCells” is not allowed for stack context ENiagaraScriptUsage::Module. Allowed: ENiagaraScriptUsage::EmitterSpawnScript, ENiagaraScriptUsage::EmitterUpdateScript, ENiagaraScriptUsage::SystemSpawnScript, ENiagaraScriptUsage::SystemUpdateScript - ".
Is there a fix for this?
Thank you very much!
Don’t worry about errors like that in the script editor. It will compile fine when you use it in your emitter/system.
I need to worry about the compile error because I’d like to modify the script. Is there something I can do about it?
In my case, it’s the script called Grid 3D Secondary Update Particles I need to edit.
I think you’re right and it compiles fine when in the system. I though the script did not work.
It seems Niagara Script Editor or inside compiler has bugs. It means that we cannot add modules properly which seriously affects new project development.
One example to show the problem is as follows.
- Create a NiagaraSystem using template example “Grid2D Gas Smoke” and open it.
- Under “Project Pressure” of Grid2D_Gas_SmokeFire_Emitter, duplicate the module of “Grid 2D Compute Gradient” and open it. Compile it and get error message of “Function call “GetGridvalue” is not allowed for stack context ENiagaraScriptUsage::Module. Allowed: …”
- This new Module does not work and does not make the Emitter Smoke moving faster upward. The original “Grid 2D Compute Gradient” does. (Of course, you need select or un-select which module for testing.)
Those errors in the module editor do not affect the emitters/systems that ues them. It should be fine once you compute the actual system.