Can Landscape and Foliage use Dynamic Material Instance?

Hey everyone,
I cannot find any solution to this.
Can I use Dynamic Material Instance for a Landscape or Foliage Actor like I do with a static mesh?

Thank you

yes, just try it.

It is not obvious that I tried it?!

It does not work inside the blueprint to connect THE InstanceFoliageActor to CreateDynamicMaterialInstance.

Have YOU tried it? Do YOU know how to do IT? Will YOU share YOUR experience with OTHERS???

“just try it”…ffs

1 Like

Hi, for the landscape I haven’t found a way (either there is a bug in my project or the bug is due to version 4.24), but from the landscape you can drag and type “material”, so you can directly set the parameters from the landscape. Second way, would be to get the material from the landscape and then use get dynamic material instance.

For the instanced foliage actor, it contains **all **the procedural spawned foliage therefore you can’t set materials for that. You would first need to use “get components by class” -> “instanced static mesh component” and do a for loop from there. Basically each foliage type you have will be one element in the components array.
[HR][/HR]And depending on what you’re trying do to, using material parameter collections might be easier, since those can be accessed from all materials and you don’t need to manually create material instances from blueprints.

By the way, without the key words “at runtime” I misunderstood your question at first too :slight_smile:

Yes, thank you and my bad, i worded the question poorly.

The Landscape worked dragging a new material and the from there a new dynamic material instance.
And for the foliage i will experiment some more with the material parameter collections like you said.

Thanks guys!