nanos world API Reference Unofficial documentation
Function Shared Slow

Paintable:SetMaterial

Sets the material at the specified index of this Actor

Syntax

Lua
my_paintable:SetMaterial(material_path, index = -1, attachable_id = "")

Parameters

Name Type Default Description
material_path MaterialPath The new Material to apply.<br/><br/>Note: depending on the entity you are applying, the material needs to be configured to be "Used with Skeletal Mesh" or "Used with Particles", etc. in the material settings, otherwise it may not be applied correctly
index optional integer -1 The material index to apply (<code>-1</code> means all indices)
attachable_id optional string "" The attachable ID (set with <code>AddSkeletalMeshAttached</code> or <code>AddStaticMeshAttached</code>) to apply the material. Pass empty to set on main mesh only