[BUG] Construction script not reflected in game

Hi,

A few days ago, I made the following post concerning a problem with BP construction scripts:

https://forums.unrealengine.com/showthread.php?70837-BP-appears-different-in-PIE-than-in-editor-please-help

I looked a bit further into this and it seems that this is indeed a bug.
The constructions script effects are only visible in the editor viewport and not in game.

To reproduce:

  • Create a material collection with a vector parameter
  • Create a material(instance) that has this collection parameter
  • Create a BP with a static mesh actor with that material
  • Change the parameter value of the collection in the construction script
  • Compile the BP
  • You will see now that the mesh material color changes in the viewport as selected
  • Hit Play
  • You will now see the mesh in its unchanged default material settings

6d1a7af9bd9549fd89f8733e5e420b709ac0b863.jpeg

My current workaround is: Wrapping all initialization code in a function and call it from the construction script (to make the editor viewport update) and the Begin Play event (to have the changes shown in game).
But its not that utterly elegant…

Cheers,
Klaus

UPDATE:

It seems to get even weirder:
The BP instances now behave as if they were one. If I change a value of a varaible of a BP instance, all other instances behave as if they were changed as well.
I made a little sample project, available here: http://www.filedropper.com/toolslite
I commented all the BP code. Just try the following and see how the objects behave

  • Observe behavior in editor and PIE, wether the (only) node in the event graph is connected to BeginPlay
  • Choose different Tint values per instance and play around with the “Override” booleans per instance. Observe how colors change on all instances
  • Change color groups per instance and see how colors change on all meshes again

Either there is something broken, or I havent understood the concept of material collections ands changing parameters at runtime. :confused:
If so, let me know what I did wrong… :slight_smile: