Ok,
Here is a quick rundown of this working, with the caveat that I assume you have used Unreal a bit:
- New Level (Basic)
A. Delete Floor Actor.
B. Set Editor to Landscape Mode (Shift+2)
C. Create Landscape with default settings.
D. Back to Selection Mode (Shift+1) - In the Content Browser, Create New Material (M_Landscape_Example)
- Open M_Landscape_Example Material Editor
A. Press ‘3’ and Left Click in the editor to create a Constant 3 Vector (or create it with the menu.)
B. Drag the Vector RGB Pin to the Material Output’s Base Color Pin.
C. Right-click on the Color Vector and convert it to a Parameter (keep it named ‘Param’)
D. Set the Color to anything other than black as default.
E. Save and Close the Material Editor - In the Content Browser, right Click the new material (M_Landscape_Example) and create a Material Instance out of it (M_Landscape_Example_Inst)
- Select the Landscape actor in the Map Editor, find the Landscape Material property, and set it to the Material Instance (M_Landscape_Example_Inst) you just created. (At this point, the landscape should show your selected color.)
- Find the “Use Dynamic Material Instance” property flag a few properties below the Landscape Material property and make sure it is set to TRUE.
- Now, Create a new Blueprint in the Content Browser. Derive from Actor and call it BP_DynamicLandscapeMaterial.
- Drag the new Blueprint Actor into the Map and place it anywhere.
- Open the BP_DynamicLandscapeMaterial Blueprint Editor.
A. Create a new Variable.
B. Call it Landscape, and set the type to a Landscape Object Reference.
C. Make the new variable “Instance Editable” in the variable properties.
D. In the Event Graph, drag the variable into the Blueprint and place a getter.
E. Convert the getter to a Validated Get and attach the input Pin to BeginPlay
F. Drag out from the Landscape Pin of the Getter and Find the SetLandscapeMaterialVectorParameterValue Blueprint Node.
G. Set the Parameter name to “Param”
H. Change the color to something different than the color in your material.
I. Compile and Close the Blueprint Editor. - In the Map, select the BP_DynamicLandscapeMaterial Actor, find the Landscape property, and set it to the Landscape in your level.
- Play the Map.
- Profit (optional.)
Note: there is no way to change the material itself on the Landscape at runtime without massive amounts of C++ engine code, but take heart because you shouldn’t need to do this since you can change textures, scalars, and vectors to your heart’s content on the material that you DO have.