fix incorrect indexing for material instances when creating an instance

This commit is contained in:
Nick Fisher
2025-06-19 10:57:54 +08:00
parent 7446b0545a
commit a823718bcd
2 changed files with 12 additions and 14 deletions

View File

@@ -90,8 +90,8 @@ namespace thermion
TRACE("Instance child entity %d not renderable", i);
} else {
TRACE("Instance child entity %d renderable", i);
for(int i = 0; i < materialInstanceCount; i++) {
rm.setMaterialInstanceAt(renderableInstance, i, materialInstances[i]);
for(int j = 0; j < materialInstanceCount; j++) {
rm.setMaterialInstanceAt(renderableInstance, i, materialInstances[j]);
}
}
}