Been fighting with this for a few days now and I think I am just not searching the right terms or something. I have a weapon trail fx asset from marketplace that works as I want it to, but I cannot figure out a way to change the color at runtime.
The trail fx are set up on the animations with custom AnimNotifyStates, as one would expect. The fx themselves are Niagara particle systems with a “start” and “end” variable that are sockets added to a mesh at the tip and base of the weapon. I added those sockets to the mesh of the character (not to the weapons themselves), if that is relevant.
The particle system uses a material that I have made an instance of in hopes of changing the color of the material itself at runtime, but I couldn’t find a usable way to reference that within the character blueprint. I also added a User Parameter to the particle system directly called “UserColor” in an attempt to change it directly, but I cannot find a way to reference that within the character blueprint, either. I have used this approach on some other particle fx within the character without issue by having the other particle systems parented to the character, but the weapon trail fx are not inside of the character blueprint so that approach falls short for me, again, because I don’t know how I would reference that from within that blueprint.
There is also a blueprint for the notify state, if that would be something I could reference within the character blueprint, but I don’t know how that would work or if that would even help. If there were a way to get a reference to the player character from within this blueprint and assign the color, that would definitely solve the issue, but trying to cast to that blueprint gives a node with a “world context” pin that I can’t figure out what to plug into.
I had expected to be able to create a dynamic material instance for the particle system and assign it within the character blueprint, but that is seeming to be much more difficult than I had originally thought. My other thought was to reference the particle system itself and just set the “UserColor”, but again it isn’t that simple. My last resort was to parent the particle system to the character and use different notifies in the animation montages to spawn and despawn the particle system with the play montage node, but I cannot see a way to reference the “start” and “end” variables of the system to pass in the socket locations of the tip and base sockets.
Sorry if this is very wordy, I’m just feeling very stuck by something that “feels” like it should be pretty simple, and the fact that I have spent multiple days on it and gotten nowhere says that there is way more to this than I had originally figured. Any help would be greatly appreciated!