[BUG] material setting order, possible Bug?

Im not sure if this is a bug or not but regardless this would require someone to look at my project therefore I would like this only to be handled by staff please.

(this is entirely a blueprint project)

I am setting a component to a new material but before doing so I get the old material and save it so i can reapply it later when the objects no longer collide, however the data saved is sometime the new mat not the old, hence it forms a loop and the material is lost.

Could someone help me to clarify if there is an issue with setting materials in the same tick ? as i have been trying to figure this out for some time now.

thank you for your time.

Hi bennetherwood -

I am not getting the same results that you are describing above. Can you take a look at the attached sample project and adjust as needed and upload it back here?

Thank You -

Eric Ketchum

Sample_Project 4.8.3

I dont think that is applicable as it involves an integral part of my game and there is a fair amount of casting to BP’s, I actually found a work around and thought i deleted the question, however I dont think its a case that the issue was fixed more that I have made it irrelevant to my project.

I would be happy to send my project to you directly and made a few comments on the relevant parts of the BP but I think you would find it a nightmare to find the issue as it is a large BP and involves many castings. Even after all this it may just be me making an error in my blueprint not the engine per-say.

Would you like me to upload it to a dropbox and send you the link privately. just to clarify my content would still be my own and wont be used/taken right ?

thank you for your help.

actually it isnt sorted, could you help me ?

Hi -

You can private message me the link via the Unreal Forums. What do you mean by “actually it isn’t sorted”? Feel free if my sample project highlights your issue, to make comments in it and upload it again here.

Thank You

Eric Ketchum

I have private messaged you, thank you.

Hi bennetherwood -

We are looking into the issue now, but I would like to recommend the possibility of using a Layered Material Controlled by an Alpha Scalar Parameter and use the set scalar parameter node in the BP therefore not needing an array of different materials.

Thank You

Eric Ketchum

I am already using this Eric for the use of build mode vs a normal game mode (in build mode all buildings are set to the same material to create a clean image) I dont really want to add another layered material to the mix as I only need overlapping materials for a temporary thing which could add more shader instructions. However i am unsure of how high the overheads are ?

Hey bennetherwood -

It actually would be more performant to have a few additional instructions in a single material versus completely new material which has not been loaded into memory yet. In either case you are adding shader instructions.

We’ve spent time looking at your blueprints and it definitely is an issue with the order of operations of the array set and call, but we’ve not been able to determine where that order breaks.

Eric Ketchum