Working in Niagara, I’m trying to use the Static Mesh Location module to emit from the surface of a mesh. This works for a simple static mesh, however I need to use a Mesh Parameter as the emission mesh will change dynamically.
The Static Mesh Location module provides options to use a Mesh Parameter Binding but the “Mesh Parameter Binding” list is always empty.
Can anyone help with the steps to define a Mesh Parameter for this module?
NiagaraStaticMeshLocation01.png(71.3 KB)
Steps to Reproduce
- Open UE
- Create a Niagara System
- Create a Static Mesh Parameter
- Add “Static Mesh Location” to the Emitter > Particle Spawn
- Set “Mesh Parameter Binding” in the “Static Mesh Location” Module.
Mesh Parameter list is empty therefore cannot reference Mesh Parameter from Module.
Hi Karl,
Indeed, there seems to be a little quirk in the UI there. From my tests, the “Mesh Parameter Binding” property of the “Static Mesh Location” module seems to only accept User Parameters of type “Object”, and not of “Static Mesh” or any other derived type.
Furthermore, when setting the parameter value dynamically in a Blueprint, so far I was only able to get it to work properly by using BP node “Set Niagara Variable by String (Object)” (not the node that takes a Name instead of a String, and not any node that takes a Static Mesh as input pin).
I’m still investigating this behavior as it might warrant an internal bug report. But for now, please try changing your Niagara Parameter type to “Object” instead of “Static Mesh”, and to change it dynamically through BP as mentioned above. Let me know if that works!
Best regards,
Vitor
Hi Victor,
thank you for your advice and for setting up the bug report.
I’ll look into the workaround you suggested.
Hi Karl. After some investigation, it seems that module properties of type “UserParameterBinding” that expect a user parameter of type “Object” do not accept binding to any other user parameter types, included types derived from “Object”.
In this case, property MeshParameterBinding is declared with “Object” type because it is meant to accept StaticMesh, StaticMeshComponent, or Actor object types. But the related user parameter itself must match that type exactly, with no regard for the class hierarchy. The hierarchy will be relevant when setting the actual parameter value in blueprints.
I will file an internal bug report about this, but it is possible that the engine devs see this as a limitation instead of a bug, which would mean that no public tracker would be available.
Best regards,
Vitor
Here’s the tracking number for the internal report: UE-361675. This link should only become available if the devs decide to handle this as a bug and a public trackable one.