Generating objects with Random - Individual - Color?

  1. List item

I’ve just started, and am loving blueprints.

But how can I connect a Color function to Creation Scripts in the blueprint editor?

I have essentially a giant pachinko machine simulating but was asked off-hand if the marbles could be something other than metal.
And surprisingly enough, I’ve been stumped on this for hours.

– Editing to add :

I have found a number of tutorials on random colors, but all have to do with Dynamic changes to a single color instance, and I’m looking for a simple method of randomizing the color of objects created by a blueprint.

Dynamic actually IS what you need. As soon as you start the game, materials are fixed. You cannot change a material inside a running game, unless you create a dynamic material instance of it.

  1. Create a material with a vector input parameter (you can plug it directly into base color) and give it a name (eg Color).
  2. Make a material instance of it
  3. Then setup your marble like [in the tutorial][1]

In the tutorial you can see how a color is passed into the material instance. all you need to do now is change this color parameter. You can use random to initialize this color parameter (eg 3x randomint plugged into a makevector)

https://docs.unrealengine.com/latest/images/Engine/Rendering/Materials/MaterialInstances/ConstructionScriptForMID.jpg