After the latest update v33.00 Setting instanced materials from verse seems to be broken.
Instancing materials like this var my_material : MaterialHere_material = MaterialHere_material{} sometimes works and sometimes doesn’t
and having them inside an array var my_material : []MaterialHere_material = array{MaterialHere_material{},MaterialHere_material{},MaterialHere_material{}}seems to not work at all
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Assets
Steps to Reproduce
Create a Materials that has parameters (Material should show up in assets.digest.verse with a suffix of _material appended to their name)
Place a creative_prop in the world
Create a verse_device that has as a class variable multiple instances of the material in an array, and a reference to the creative_prop placed in the world
Inside the OnBegin Function get the material from any index of the array (EXCEPT INDEX 0) and set that material to the creative_prop using the creative_prop.SetMaterial() function
Expected Result
Setting the material of a prop through verse should have the material apply In-Game
In the video two identical cubes were placed with one getting the material set directly by instancing a material on the spot (The Material is applied correctly)
And the other cube is getting the material set by first getting the material instanced from the array (Index 2) and then setting it (The Material is not applied)
Thanks a lot for the detailed and concise repro. The attached project in particular was very useful in identifying what’s happening here.
The issue stems from the array being stuck at the size it was when you added it to the map in the first place. If you place a device into the level while 2 elements exist in code, then add another element in code and recompile, the instance of the device in the level will remain at 2 elements. In your example project it appears the device would have been added to the level with only a single element and the code was updated afterwards?
This isn’t directly related to materials and is a bit of a bigger problem which we are working to address. But in the mean time you may be able to work around this issue by replacing the device with the correct number of elements after a recompile. Or you might be able to leverage an @editable array to populate the elements.