A
A
Alexander Osherov2019-12-15 01:01:14
C++ / C#
Alexander Osherov, 2019-12-15 01:01:14

How to setup correct SkinnedMeshRenderer in Unity 3d?

There are several prefabs based on them (using them as bones) create a Skinned object (cylinder)
now I do this (each prefab has the name Cell + number)

SkinnedMeshRenderer NewRenderer = GameObject.Find("Cylinder").GetComponent(typeof(SkinnedMeshRenderer)) as SkinnedMeshRenderer;
        Transform[] MyBones = new Transform[col];

        for (int i = 1; i < col; i++)
            MyBones[i] = GameObject.Find("Cell" + (i).ToString()).transform;

        NewRenderer.bones = MyBones;
        NewRenderer.rootBone = GameObject.Find("Cell0").transform;

but as a result only the effect around the rootBone is visible

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