I have been having issues of working with a material parameter collection in C++. So far I haven’t found a working solution to accessing a parameter collection made in editor and changing the values in code.
I have been trying to get it work since yesterday and found little info on the subject on the forums or answerhub. Either I’m not quite understanding how they work with code or I’m missing something.
Overall I’m stumped on how to make this work.
So far though I’m wondering if this is the best method to do this or if there is another more efficient way? Since they list 4 of them and I’m still learning I’m not sure which of these is best for my case.
Adding a property as a reference to the collection is probably the best way. You could just load the asset by name, but that won’t work properly for cooked content (you’ll have to force that asset to be cooked). If you have something that references it and the class you add the property to gets cooked (like PlayerController or Pawn), then the referenced asset (the collection) will also get cooked.