# When implementing material changes in Verse, what should I do if the mesh has multiple material elements?

**URL:** <https://forums.unrealengine.com/t/when-implementing-material-changes-in-verse-what-should-i-do-if-the-mesh-has-multiple-material-elements/2630507>\
**Category:** Verse\
**Tags:** unreal-engine, unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [August 5, 2025, 5:56am UTC](https://forums.unrealengine.com/t/when-implementing-material-changes-in-verse-what-should-i-do-if-the-mesh-has-multiple-material-elements/2630507 "2025-08-05T05:56:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![toy-ichi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/toy-ichi/32/1030681_2.png) [@toy-ichi](https://forums.unrealengine.com/u/toy-ichi)\
**Post date:** [August 5, 2025, 5:56am UTC](https://forums.unrealengine.com/t/when-implementing-material-changes-in-verse-what-should-i-do-if-the-mesh-has-multiple-material-elements/2630507/1 "2025-08-05T05:56:47Z")

</div>

When changing materials in Verse using the `SetMaterial` function to modify a `creative_prop`’s material, is it possible to change only a specific part of the prop if it has multiple material elements, rather than just a single one?

If so, how should the code be written to achieve this?

I would appreciate your guidance. Thank you.

 ![スクリーンショット 2025-08-05 145304](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/e/8/ae8420fc9996a36fed3efa2a8da8d7f076e4d2e0.png)  
 ![スクリーンショット 2025-08-05 145246](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/f/ecfa530e15ea4085538fb1b73403e217adb80169.png)

---

<div class="post-metadata">

**Author:** ![toy-ichi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/toy-ichi/32/1030681_2.png) [@toy-ichi](https://forums.unrealengine.com/u/toy-ichi)\
**Post date:** [August 5, 2025, 9:43am UTC](https://forums.unrealengine.com/t/when-implementing-material-changes-in-verse-what-should-i-do-if-the-mesh-has-multiple-material-elements/2630507/2 "2025-08-05T09:43:17Z")

</div>

Even when I write PaintProp.SetMaterial(Materials.PaintPicker\_Black, 1),  
an error still occurs.  
I want to change material slot [1] to Black, but it doesn’t work.

 ![スクリーンショット 2025-08-05 184142](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/f/a8f197c276be3ef3dcd6526817e723e3f913d3a8.png)

---

<div class="post-metadata">

**Author:** ![KamilEGPP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KamilEGPP](https://forums.unrealengine.com/u/KamilEGPP)\
**Post date:** [August 18, 2025, 2:41pm UTC](https://forums.unrealengine.com/t/when-implementing-material-changes-in-verse-what-should-i-do-if-the-mesh-has-multiple-material-elements/2630507/3 "2025-08-18T14:41:52Z")

</div>

Hello!

Sorry for the confusion!  
I asked docs team to add section about defining and using optional parameters.

Correct syntax for setting value to optional argument is:

```auto
Foo(?OptionalArg := 1)

```

So in your case it should be:

```auto
PaintProp.SetMaterial(Materials.PaintPicker_Black, ?Index := 1)

```

You may also consider storing your materials in array, so whole if/else if chain could be simplified to:

```auto
if (Material := MyMaterialsArray[Index]):
    PaintProp.SetMaterial(Material, ?Index := 1)

```

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [August 21, 2025, 12:54pm UTC](https://forums.unrealengine.com/t/when-implementing-material-changes-in-verse-what-should-i-do-if-the-mesh-has-multiple-material-elements/2630507/4 "2025-08-21T12:54:25Z")

</div>

looking at the documentation, it seems that you have a parameter for choosing which material slot you update

```verse
# Changes the Material of the Mesh used by this instance. Optionally can specify which Mesh element index to apply the material to, otherwise defaults to the 0 (default) Mesh element
SetMaterial<native><public>(Material:material, ?Index:int = external {})<transacts>:void

SetMaterial(MyMaterial, ?Index := 2)

```
