Skip to content

raylib.SetModelMeshMaterial

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Set the material for a mesh

Parameters

Parameter Default Value Note
model
meshId
materialId

Return value

None.

Notes

Example

model = raylib.LoadModel("model.obj")
mats = raylib.LoadMaterials("model.mtl")
// Assign the first material to the first mesh
raylib.SetModelMeshMaterial model, 0, 0
raylib.UnloadModel model
for mat in mats
    raylib.UnloadMaterial mat
end for

Clone this wiki locally