Cached Material in Particle?

Hey guys,

Sorry for the weird title, but I don’t exactly know what I’m dealing with here. I promise I’ve tried searching, so if this is just common knowledge and has been asked a billion times, I’m really sorry.

I’ve got projectile trails based on the team a player is on. Red team’s are, you guess it, red. Blue team’s are blue. The materials themselves look great. The only problem is that I think there is some form of material caching going on as throughout an entire game the trails will only be one color (for both teams). The reason I think it’s caching is because it’s random which color it is. I know the team color functionality is working fine because my camo is based on the team colors. See here:

Blue team player with blue camo (based on team color) and blue projectile trail. Looks like it’s working right? …

Read team player with red camo and blue projectile trail. Gah!

How can I prevent this trail particle from caching the material? Or, if that’s not what’s going on, what is, and how can I fix it?

Thanks in advance.

The biggest question is - how do you set your material? The particle system does not cache anything, the chances are that at particle instantiation you are feeding one material / color to all the particles.

Regardless of what you do, what you ought to do is have a Dynamic Material Parameter that you set via Blueprint. Inside your material have that dynamic parameter lerp between your red and blue color (which you should store in a material parameter collection and have all your team-color materials read fom that MPC; that way if you want to alter team colors down the line you only have to do so in one place).

Super good to know that they don’t ever cache. With your guidance, I was able to fix the problem. The scalar parameter was being set in the wrong order. Seems to be working well now. Thanks a ton for the timely, helpful response!