Dynamically Create and Set Material Instance for Specific Emitter in Unreal Engine C++

Hello,

I’m working with Niagara particle systems in Unreal Engine using C++, and I need to dynamically create and set a material instance for a specific emitter within a particle system.

  1. How can I dynamically create and set a material instance for a specific emitter in a Niagara particle system using C++?
  2. How can I determine the index of an emitter within a Niagara system, and is it possible to get the index of an emitter by its name?

Any guidance or code examples would be greatly appreciated!

Thank you!