After Spawning Static Mesh I cant Change its Color?

Hi Guys, i am working on a model in UE, i am using Create Dynamic Material Instance to change my static mesh color, but when i add the spawn command to the static mesh i easily spawn my static mesh but i am not able to change its color when its spawned? but without using spawn command the static mesh is already there in the scene the Dynamic Material command works fines… so what i am doing wrong? how i can combine the Dynamic Materials and Spawning Object blueprint?

I actually just answered this in the C++ forum:

Solution

Set your mesh to have mobility movable BEFORE trying to change its position or static mesh or materials to use your dynamic instance

Enjoy!

Rama

I have set it to Movable but still having the same problem…

So I put this example together for you.

a723dfa9e2b7da577a200b8ba1143a091d57f83e.jpeg


Begin Object Class=EdGraphNode_Comment Name="EdGraphNode_Comment_2"
   NodePosX=1008
   NodePosY=960
   NodeWidth=1648
   NodeHeight=864
   NodeComment="Create Dynamic Objects w/ Random Color"
   bCommentBubbleVisible=False
   NodeGuid=A986C1D5491310FC78BCD7B8F0F94EF7
End Object
Begin Object Class=K2Node_SpawnActorFromClass Name="K2Node_SpawnActorFromClass_93"
   Begin Object Class=EdGraphPin Name="EdGraphPin_13193"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13192"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13191"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13190"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13189"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13188"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13376"
   End Object
   Begin Object Name="EdGraphPin_13193"
      PinName="ReturnValue"
      PinToolTip="Return Value
BP The Ball Reference

The spawned Actor"
      Direction=EGPD_Output
      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/BP_TheBall.BP_TheBall_C')
      LinkedTo(0)=EdGraphPin'K2Node_CallFunctionOnMember_0.EdGraphPin_15083'
   End Object
   Begin Object Name="EdGraphPin_13192"
      PinName="SpawnEvenIfColliding"
      PinToolTip="Spawn Even if Colliding
Boolean

Determines if the Actor should be spawned when the location is blocked by a collision"
      PinType=(PinCategory="bool")
   End Object
   Begin Object Name="EdGraphPin_13191"
      PinName="SpawnTransform"
      PinToolTip="Spawn Transform
Transform 

The transform to spawn the Actor with"
      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Transform')
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2539.EdGraphPin_13228'
   End Object
   Begin Object Name="EdGraphPin_13190"
      PinName="Class"
      PinToolTip="Class
Actor Class

The Actor class you want to spawn"
      PinType=(PinCategory="class",PinSubCategoryObject=Class'/Script/Engine.Actor')
      DefaultObject=BlueprintGeneratedClass'/Game/BP_TheBall.BP_TheBall_C'
   End Object
   Begin Object Name="EdGraphPin_13189"
      PinName="then"
      Direction=EGPD_Output
      PinType=(PinCategory="exec")
      LinkedTo(0)=EdGraphPin'K2Node_CallFunctionOnMember_0.EdGraphPin_15081'
   End Object
   Begin Object Name="EdGraphPin_13188"
      PinName="execute"
      PinType=(PinCategory="exec")
      LinkedTo(0)=EdGraphPin'K2Node_MacroInstance_154.EdGraphPin_13523'
   End Object
   Begin Object Name="EdGraphPin_13376"
      PinName="Instigator"
      PinToolTip="Instigator
Pawn Reference

Pawn responsible for damage caused by this actor."
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Pawn')
   End Object
   Pins(0)=EdGraphPin'EdGraphPin_13188'
   Pins(1)=EdGraphPin'EdGraphPin_13189'
   Pins(2)=EdGraphPin'EdGraphPin_13190'
   Pins(3)=EdGraphPin'EdGraphPin_13191'
   Pins(4)=EdGraphPin'EdGraphPin_13192'
   Pins(5)=EdGraphPin'EdGraphPin_13193'
   Pins(6)=EdGraphPin'EdGraphPin_13376'
   NodePosX=1504
   NodePosY=1248
   ErrorType=1
   ErrorMsg="Error The current value of the \' Spawn Transform \' pin is invalid: \'Spawn Transform\' must have an input wired into it (\"by ref\" params expect a valid input to operate on).
Error The current value of the \' Spawn Transform \' pin is invalid: \'Spawn Transform\' must have an input wired into it (\"by ref\" params expect a valid input to operate on)."
   NodeGuid=16CD613848782278EA2A4A92904C6F32
End Object
Begin Object Class=K2Node_MacroInstance Name="K2Node_MacroInstance_154"
   Begin Object Class=EdGraphPin Name="EdGraphPin_13525"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13524"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13523"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13522"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13521"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13520"
   End Object
   Begin Object Name="EdGraphPin_13525"
      PinName="Completed"
      Direction=EGPD_Output
      PinType=(PinCategory="exec")
   End Object
   Begin Object Name="EdGraphPin_13524"
      PinName="Index"
      Direction=EGPD_Output
      PinType=(PinCategory="int")
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2541.EdGraphPin_13255'
   End Object
   Begin Object Name="EdGraphPin_13523"
      PinName="LoopBody"
      Direction=EGPD_Output
      PinType=(PinCategory="exec")
      LinkedTo(0)=EdGraphPin'K2Node_SpawnActorFromClass_93.EdGraphPin_13188'
   End Object
   Begin Object Name="EdGraphPin_13522"
      PinName="LastIndex"
      PinType=(PinCategory="int")
      DefaultValue="2"
   End Object
   Begin Object Name="EdGraphPin_13521"
      PinName="FirstIndex"
      PinType=(PinCategory="int")
      DefaultValue="0"
   End Object
   Begin Object Name="EdGraphPin_13520"
      PinName="execute"
      PinType=(PinCategory="exec")
      LinkedTo(0)=EdGraphPin'K2Node_Event_147.EdGraphPin_13363'
   End Object
   MacroGraphReference=(MacroGraph=EdGraph'/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForLoop',GraphBlueprint=Blueprint'/Engine/EditorBlueprintResources/StandardMacros.StandardMacros',GraphGuid=55C904AF4B45FE1761FB55A8DB9FB801)
   Pins(0)=EdGraphPin'EdGraphPin_13520'
   Pins(1)=EdGraphPin'EdGraphPin_13521'
   Pins(2)=EdGraphPin'EdGraphPin_13522'
   Pins(3)=EdGraphPin'EdGraphPin_13523'
   Pins(4)=EdGraphPin'EdGraphPin_13524'
   Pins(5)=EdGraphPin'EdGraphPin_13525'
   NodePosX=1232
   NodePosY=1040
   ErrorType=1
   ErrorMsg="Error Unexpected node type K2Node_MacroInstance encountered at  ForLoop "
   NodeGuid=D25E4AB846166D48B92682A02E0B31F3
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2539"
   Begin Object Class=EdGraphPin Name="EdGraphPin_13228"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13227"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13226"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13225"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13224"
   End Object
   Begin Object Name="EdGraphPin_13228"
      PinName="ReturnValue"
      PinToolTip="Return Value
Transform "
      Direction=EGPD_Output
      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Transform')
      LinkedTo(0)=EdGraphPin'K2Node_SpawnActorFromClass_93.EdGraphPin_13191'
   End Object
   Begin Object Name="EdGraphPin_13227"
      PinName="Scale"
      PinToolTip="Scale
Vector "
      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
      DefaultValue="1,1,1"
      AutogeneratedDefaultValue="1,1,1"
   End Object
   Begin Object Name="EdGraphPin_13226"
      PinName="Rotation"
      PinToolTip="Rotation
Rotator "
      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Rotator')
      DefaultValue="0, 0, 0"
      AutogeneratedDefaultValue="0, 0, 0"
   End Object
   Begin Object Name="EdGraphPin_13225"
      PinName="Location"
      PinToolTip="Location
Vector "
      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
      DefaultValue="0, 0, 0"
      AutogeneratedDefaultValue="0, 0, 0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2540.EdGraphPin_13243'
   End Object
   Begin Object Name="EdGraphPin_13224"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Kismet Math Library Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
      DefaultObject=Default__KismetMathLibrary
      bHidden=True
   End Object
   bIsPureFunc=True
   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="MakeTransform")
   Pins(0)=EdGraphPin'EdGraphPin_13224'
   Pins(1)=EdGraphPin'EdGraphPin_13225'
   Pins(2)=EdGraphPin'EdGraphPin_13226'
   Pins(3)=EdGraphPin'EdGraphPin_13227'
   Pins(4)=EdGraphPin'EdGraphPin_13228'
   NodePosX=1152
   NodePosY=1264
   NodeGuid=DDA096BC4BC9BB93F16F1D9FF01056D4
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2540"
   Begin Object Class=EdGraphPin Name="EdGraphPin_13243"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13242"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13241"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13240"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13239"
   End Object
   Begin Object Name="EdGraphPin_13243"
      PinName="ReturnValue"
      PinToolTip="Return Value
Vector "
      Direction=EGPD_Output
      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
      DefaultValue="0, 0, 0"
      AutogeneratedDefaultValue="0, 0, 0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2539.EdGraphPin_13225'
   End Object
   Begin Object Name="EdGraphPin_13242"
      PinName="Z"
      PinToolTip="Z
Float"
      PinType=(PinCategory="float")
      DefaultValue="100"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_13241"
      PinName="Y"
      PinToolTip="Y
Float"
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2544.EdGraphPin_13341'
   End Object
   Begin Object Name="EdGraphPin_13240"
      PinName="X"
      PinToolTip="X
Float"
      PinType=(PinCategory="float")
      DefaultValue="-200"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_13239"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Kismet Math Library Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
      DefaultObject=Default__KismetMathLibrary
      bHidden=True
   End Object
   bIsPureFunc=True
   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="MakeVector")
   Pins(0)=EdGraphPin'EdGraphPin_13239'
   Pins(1)=EdGraphPin'EdGraphPin_13240'
   Pins(2)=EdGraphPin'EdGraphPin_13241'
   Pins(3)=EdGraphPin'EdGraphPin_13242'
   Pins(4)=EdGraphPin'EdGraphPin_13243'
   NodePosX=1856
   NodePosY=1088
   NodeGuid=0B694FEF49501A0BAF669C8E08929CAC
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2541"
   Begin Object Class=EdGraphPin Name="EdGraphPin_13257"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13256"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13255"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13254"
   End Object
   Begin Object Name="EdGraphPin_13257"
      PinName="ReturnValue"
      PinToolTip="Return Value
Float"
      Direction=EGPD_Output
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2544.EdGraphPin_13339'
   End Object
   Begin Object Name="EdGraphPin_13256"
      PinName="B"
      PinToolTip="B
Float"
      PinType=(PinCategory="float")
      DefaultValue="150"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_13255"
      PinName="A"
      PinToolTip="A
Integer"
      PinType=(PinCategory="int")
      DefaultValue="0"
      AutogeneratedDefaultValue="0"
      LinkedTo(0)=EdGraphPin'K2Node_MacroInstance_154.EdGraphPin_13524'
   End Object
   Begin Object Name="EdGraphPin_13254"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Kismet Math Library Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
      DefaultObject=Default__KismetMathLibrary
      bHidden=True
   End Object
   bIsPureFunc=True
   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="Multiply_IntFloat")
   Pins(0)=EdGraphPin'EdGraphPin_13254'
   Pins(1)=EdGraphPin'EdGraphPin_13255'
   Pins(2)=EdGraphPin'EdGraphPin_13256'
   Pins(3)=EdGraphPin'EdGraphPin_13257'
   NodePosX=1520
   NodePosY=1104
   NodeGuid=0B1B4EA2422E8ECA830D9D8A88DA75D1
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2544"
   Begin Object Class=EdGraphPin Name="EdGraphPin_13341"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13340"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13339"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13338"
   End Object
   Begin Object Name="EdGraphPin_13341"
      PinName="ReturnValue"
      PinToolTip="Return Value
Float"
      Direction=EGPD_Output
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2540.EdGraphPin_13241'
   End Object
   Begin Object Name="EdGraphPin_13340"
      PinName="B"
      PinToolTip="B
Float"
      PinType=(PinCategory="float")
      DefaultValue="150"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_13339"
      PinName="A"
      PinToolTip="A
Float"
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2541.EdGraphPin_13257'
   End Object
   Begin Object Name="EdGraphPin_13338"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Kismet Math Library Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
      DefaultObject=Default__KismetMathLibrary
      bHidden=True
   End Object
   bIsPureFunc=True
   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="Subtract_FloatFloat")
   Pins(0)=EdGraphPin'EdGraphPin_13338'
   Pins(1)=EdGraphPin'EdGraphPin_13339'
   Pins(2)=EdGraphPin'EdGraphPin_13340'
   Pins(3)=EdGraphPin'EdGraphPin_13341'
   NodePosX=1680
   NodePosY=1104
   NodeGuid=6636B18D45C2E8D96A84369AB8EDCEEF
End Object
Begin Object Class=K2Node_Event Name="K2Node_Event_147"
   Begin Object Class=EdGraphPin Name="EdGraphPin_13363"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_13362"
   End Object
   Begin Object Name="EdGraphPin_13363"
      PinName="then"
      Direction=EGPD_Output
      PinType=(PinCategory="exec")
      LinkedTo(0)=EdGraphPin'K2Node_MacroInstance_154.EdGraphPin_13520'
   End Object
   Begin Object Name="EdGraphPin_13362"
      PinName="OutputDelegate"
      Direction=EGPD_Output
      PinType=(PinCategory="delegate",PinSubCategoryMemberReference=(MemberParentClass=Class'/Script/Engine.Actor',MemberName="ReceiveBeginPlay"))
   End Object
   EventSignatureName="ReceiveBeginPlay"
   EventSignatureClass=Class'/Script/Engine.Actor'
   bOverrideFunction=True
   Pins(0)=EdGraphPin'EdGraphPin_13362'
   Pins(1)=EdGraphPin'EdGraphPin_13363'
   NodePosX=1040
   NodePosY=1056
   NodeGuid=BD8E8E7B457FB6B394F1C4B5A082DFA8
End Object
Begin Object Class=K2Node_CallFunctionOnMember Name="K2Node_CallFunctionOnMember_0"
   Begin Object Class=EdGraphPin Name="EdGraphPin_15086"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15085"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15084"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15083"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15082"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15081"
   End Object
   Begin Object Name="EdGraphPin_15086"
      PinName="ReturnValue"
      PinToolTip="Return Value
Material Instance Dynamic Reference"
      Direction=EGPD_Output
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.MaterialInstanceDynamic')
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_1907.EdGraphPin_15221'
   End Object
   Begin Object Name="EdGraphPin_15085"
      PinName="SourceMaterial"
      PinToolTip="Source Material
Material Interface Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.MaterialInterface')
      DefaultObject=Material'/Game/M_TheMaterial.M_TheMaterial'
   End Object
   Begin Object Name="EdGraphPin_15084"
      PinName="ElementIndex"
      PinToolTip="Element Index
Integer

The index of the skin to replace the material for.  If invalid, the material is unchanged and NULL is returned."
      PinType=(PinCategory="int")
      DefaultValue="0"
      AutogeneratedDefaultValue="0"
   End Object
   Begin Object Name="EdGraphPin_15083"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Static Mesh Actor Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.StaticMeshActor')
      LinkedTo(0)=EdGraphPin'K2Node_SpawnActorFromClass_93.EdGraphPin_13193'
   End Object
   Begin Object Name="EdGraphPin_15082"
      PinName="then"
      Direction=EGPD_Output
      PinType=(PinCategory="exec")
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_1907.EdGraphPin_15219'
   End Object
   Begin Object Name="EdGraphPin_15081"
      PinName="execute"
      PinType=(PinCategory="exec")
      LinkedTo(0)=EdGraphPin'K2Node_SpawnActorFromClass_93.EdGraphPin_13189'
   End Object
   MemberVariableToCallOn=(MemberParentClass=Class'/Script/Engine.StaticMeshActor',MemberName="StaticMeshComponent")
   FunctionReference=(MemberParentClass=Class'/Script/Engine.PrimitiveComponent',MemberName="CreateDynamicMaterialInstance")
   Pins(0)=EdGraphPin'EdGraphPin_15081'
   Pins(1)=EdGraphPin'EdGraphPin_15082'
   Pins(2)=EdGraphPin'EdGraphPin_15083'
   Pins(3)=EdGraphPin'EdGraphPin_15084'
   Pins(4)=EdGraphPin'EdGraphPin_15085'
   Pins(5)=EdGraphPin'EdGraphPin_15086'
   NodePosX=1920
   NodePosY=1280
   NodeGuid=6FFBCF7840C3AE06EE7B13A938A5CA9B
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_1907"
   Begin Object Class=EdGraphPin Name="EdGraphPin_15223"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15222"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15221"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15220"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15219"
   End Object
   Begin Object Name="EdGraphPin_15223"
      PinName="Value"
      PinToolTip="Value
Linear Color Structure"
      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:LinearColor')
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2066.EdGraphPin_15275'
   End Object
   Begin Object Name="EdGraphPin_15222"
      PinName="ParameterName"
      PinToolTip="Parameter Name
Name"
      PinType=(PinCategory="name")
      DefaultValue="BallColor"
      AutogeneratedDefaultValue="None"
   End Object
   Begin Object Name="EdGraphPin_15221"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Material Instance Dynamic Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.MaterialInstanceDynamic')
      LinkedTo(0)=EdGraphPin'K2Node_CallFunctionOnMember_0.EdGraphPin_15086'
   End Object
   Begin Object Name="EdGraphPin_15220"
      PinName="then"
      Direction=EGPD_Output
      PinType=(PinCategory="exec")
   End Object
   Begin Object Name="EdGraphPin_15219"
      PinName="execute"
      PinType=(PinCategory="exec")
      LinkedTo(0)=EdGraphPin'K2Node_CallFunctionOnMember_0.EdGraphPin_15082'
   End Object
   FunctionReference=(MemberParentClass=Class'/Script/Engine.MaterialInstanceDynamic',MemberName="SetVectorParameterValue")
   Pins(0)=EdGraphPin'EdGraphPin_15219'
   Pins(1)=EdGraphPin'EdGraphPin_15220'
   Pins(2)=EdGraphPin'EdGraphPin_15221'
   Pins(3)=EdGraphPin'EdGraphPin_15222'
   Pins(4)=EdGraphPin'EdGraphPin_15223'
   NodePosX=2352
   NodePosY=1312
   NodeGuid=A4DF412F48517CEEF23BDB80DFC87988
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2064"
   Begin Object Class=EdGraphPin Name="EdGraphPin_15237"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15236"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15235"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15234"
   End Object
   Begin Object Name="EdGraphPin_15237"
      PinName="ReturnValue"
      PinToolTip="Return Value
Float"
      Direction=EGPD_Output
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2066.EdGraphPin_15271'
   End Object
   Begin Object Name="EdGraphPin_15236"
      PinName="Max"
      PinToolTip="Max
Float"
      PinType=(PinCategory="float")
      DefaultValue="1.0"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_15235"
      PinName="Min"
      PinToolTip="Min
Float"
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_15234"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Kismet Math Library Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
      DefaultObject=Default__KismetMathLibrary
      bHidden=True
   End Object
   bIsPureFunc=True
   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="RandomFloatInRange")
   Pins(0)=EdGraphPin'EdGraphPin_15234'
   Pins(1)=EdGraphPin'EdGraphPin_15235'
   Pins(2)=EdGraphPin'EdGraphPin_15236'
   Pins(3)=EdGraphPin'EdGraphPin_15237'
   NodePosX=1616
   NodePosY=1488
   NodeGuid=5C0E31CD449F24105A3209B496591384
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2065"
   Begin Object Class=EdGraphPin Name="EdGraphPin_15249"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15248"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15247"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15246"
   End Object
   Begin Object Name="EdGraphPin_15249"
      PinName="ReturnValue"
      PinToolTip="Return Value
Float"
      Direction=EGPD_Output
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2066.EdGraphPin_15272'
   End Object
   Begin Object Name="EdGraphPin_15248"
      PinName="Max"
      PinToolTip="Max
Float"
      PinType=(PinCategory="float")
      DefaultValue="1.0"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_15247"
      PinName="Min"
      PinToolTip="Min
Float"
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_15246"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Kismet Math Library Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
      DefaultObject=Default__KismetMathLibrary
      bHidden=True
   End Object
   bIsPureFunc=True
   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="RandomFloatInRange")
   Pins(0)=EdGraphPin'EdGraphPin_15246'
   Pins(1)=EdGraphPin'EdGraphPin_15247'
   Pins(2)=EdGraphPin'EdGraphPin_15248'
   Pins(3)=EdGraphPin'EdGraphPin_15249'
   NodePosX=1616
   NodePosY=1584
   NodeGuid=83869D7A4D60E1F3C4F0CB9EB070DC56
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2063"
   Begin Object Class=EdGraphPin Name="EdGraphPin_15261"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15260"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15259"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15258"
   End Object
   Begin Object Name="EdGraphPin_15261"
      PinName="ReturnValue"
      PinToolTip="Return Value
Float"
      Direction=EGPD_Output
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2066.EdGraphPin_15273'
   End Object
   Begin Object Name="EdGraphPin_15260"
      PinName="Max"
      PinToolTip="Max
Float"
      PinType=(PinCategory="float")
      DefaultValue="1.0"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_15259"
      PinName="Min"
      PinToolTip="Min
Float"
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
   End Object
   Begin Object Name="EdGraphPin_15258"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Kismet Math Library Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
      DefaultObject=Default__KismetMathLibrary
      bHidden=True
   End Object
   bIsPureFunc=True
   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="RandomFloatInRange")
   Pins(0)=EdGraphPin'EdGraphPin_15258'
   Pins(1)=EdGraphPin'EdGraphPin_15259'
   Pins(2)=EdGraphPin'EdGraphPin_15260'
   Pins(3)=EdGraphPin'EdGraphPin_15261'
   NodePosX=1616
   NodePosY=1680
   NodeGuid=9C14DF344A320DD37799C39EABCE6B42
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2066"
   Begin Object Class=EdGraphPin Name="EdGraphPin_15275"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15274"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15273"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15272"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15271"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_15270"
   End Object
   Begin Object Name="EdGraphPin_15275"
      PinName="ReturnValue"
      PinToolTip="Return Value
Linear Color Structure"
      Direction=EGPD_Output
      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:LinearColor')
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_1907.EdGraphPin_15223'
   End Object
   Begin Object Name="EdGraphPin_15274"
      PinName="A"
      PinToolTip="A
Float"
      PinType=(PinCategory="float")
      DefaultValue="1.000000"
      AutogeneratedDefaultValue="1.000000"
   End Object
   Begin Object Name="EdGraphPin_15273"
      PinName="B"
      PinToolTip="B
Float"
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2063.EdGraphPin_15261'
   End Object
   Begin Object Name="EdGraphPin_15272"
      PinName="G"
      PinToolTip="G
Float"
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2065.EdGraphPin_15249'
   End Object
   Begin Object Name="EdGraphPin_15271"
      PinName="R"
      PinToolTip="R
Float"
      PinType=(PinCategory="float")
      DefaultValue="0.0"
      AutogeneratedDefaultValue="0.0"
      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2064.EdGraphPin_15237'
   End Object
   Begin Object Name="EdGraphPin_15270"
      PinName="self"
      PinFriendlyName="Target"
      PinToolTip="Target
Kismet Math Library Reference"
      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
      DefaultObject=Default__KismetMathLibrary
      bHidden=True
   End Object
   bIsPureFunc=True
   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="MakeColor")
   Pins(0)=EdGraphPin'EdGraphPin_15270'
   Pins(1)=EdGraphPin'EdGraphPin_15271'
   Pins(2)=EdGraphPin'EdGraphPin_15272'
   Pins(3)=EdGraphPin'EdGraphPin_15273'
   Pins(4)=EdGraphPin'EdGraphPin_15274'
   Pins(5)=EdGraphPin'EdGraphPin_15275'
   NodePosX=1920
   NodePosY=1552
   NodeGuid=B59F725B44C72E25413B0F9702E4928B
End Object


The dynamic material color (BallColor) is a “Vector Parameter”. Then you can change this with “Set Vector Parameter Value” with the new “Create Dynamic Material Instance”.

Hope that helps.