A
A
Andrey Eskov2018-12-06 23:35:23
Unity
Andrey Eskov, 2018-12-06 23:35:23

How to pass material to SkinnedMeshRenderer?

Good afternoon. Please tell me how to transfer the material to the SkinnedMeshRenderer, but not to key 0 but to key 1.

Screen
5c09874120f7d671391298.png
//Так он меняет первое значение
var view = character.GetComponentInChildren<SkinnedMeshRenderer>();
view.material = material;

//А вот так по идее должен бы поменять, но не меняет
var view = character.GetComponentInChildren<SkinnedMeshRenderer>();
view.materials[1] = material;

// Пробовал и так 
var view = character.GetComponentInChildren<SkinnedMeshRenderer>();
view.materials.SetValue(material , 1);

I just have the first material is the body, and the second material is the head, and the materials need to be changed from scripts, help me solve the issue.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question